Solved

WML/WAP and Database Access how do i make my WAP pages dynamic

Posted on 2003-11-07
12
3,202 Views
Last Modified: 2013-12-27
Hey there guys,

i've created a WAP website with a selection of ringtones for myselve that i can download on the fly - i've had to create a WAP site because my phone doesnt come with any serial cable also cables are not available in order to connect a phone to a PC.

i can use the WAP site on the move so that i can download my ringtones.

But what i want to do now is make the WAP site more dynamic as i have alot of ringtones that i want to add to the site but i know that if i had them it will take a very long time as i want them in categories and in alphatical order i'll also like a page which shows only the ringtones i've added in the last 3 days.

i know that this can be done with ASP and creating a database to store the information but how would i do this.

my idea is that i create a website which i use to input new records into the database (including the name of the ringtone, category of the ringtones, date ringtone entered, size of ringtone, full link to ringtone)

i then want to create some dynamic wml pages that let allow me to search the database, and click on a link that will open up the ringtone. and also show me the ringtones in the categories, and alphabetically.


can someone please help me with this, i'm a complete beginner - i've only just started making A WAP SITE. i'm also not really any good at ASP the ASP site i did make was using dreamweaver mx and very simple using wizards etc.

i could do with all the help in the world so i'm offering all the points i have as i would like tog et this done very very soon.


thanks again


also would it be easier to do this in asp or PHP or which dynamic lanuguage would be better?




0
Comment
Question by:MiamiDolphins
12 Comments
 

Author Comment

by:MiamiDolphins
Comment Utility
Can anyone help me please

i'll increase points if needed


please please please.

0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
There is a significant amount of work involved in trying to answer your question ;-)

I haven't posted before now because I haven't used ASP, Dreamweaver or anything like that.  I have a website that automatically switches between HTML and WML depending upon the Accept header in the request, but it's all written using JSPs and Servlets running on a Tomcat 4 server.

You might be able to create what you want more "efficiently" using PHP, but if you are considering ASP, I guess that this is not as important as having a site that you can manage and update easily.

If you can consider using Java to implement the server, then I am happy to help you through the process, but I'm a bit wary of getting too heaviliy involved in teaching you everything you need to know.  Forgive me if you are expecting to do a lot of work on your own, some EE users do tend to start asking extremely detailed questions as they try to run before they can walk ;-)

If you're serious about using Servlets/JSP, then check out the following link.  I've learned almost everything I know from this guy's books.  They are superbly written and the examples are clear and useful.

http://www.coreservlets.com
http://www.moreservlets.com

If you're not interested in using Java for this project, please post a quick note so that I can leave this to another expert.

Whatever you decide, there are other TAs on EE that may be more useful, since you seem to have the wireless side sorted out.  Try the JSP, ASP and PHP TAs under Web Languages.

Good luck ;-)
0
 

Author Comment

by:MiamiDolphins
Comment Utility
what would be the easiest way to do what i need

ASP?

or your method?


i've duplicated this question in the ASP section now - but still no response sadly :-(

i need all the help i can get as its so damn hard to update my wap site so i really need to make it dynamic


0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
With my limited knowledge of ASP ;-) I think that the ASP development route would be very similar to the JSP development route.  As far as I understand it, they both provide similar functionality.

If you already have a server that handles ASP, this might be the most sensible way forward.  At least you are familiar with the server and the way it works.

I'll see if I can get someone to have a look at the question on the ASP TA.
0
 

Author Comment

by:MiamiDolphins
Comment Utility
ok thanks


things i know how to do already.


1. create good database for project

2. i've created a ASP site before without any problems (using dreamweaver)

3. basic knowledge of WML

now i need to make my WML site dynamic and thats it
0
 

Author Comment

by:MiamiDolphins
Comment Utility
I'm really struggling so lets ask this question differently.

I basically want to create a dynamic WAP site.

I want to do this using ASP as thats supported on my server.

the site will not need to do much its a pretty simple site really.


heres what i want it to do.


1. connect to a access database (the database contains three tables)

TYPE
typeid
type

CATEGORY
categoryID
category

ITEM
itemid
item
category
type
URL (this is the full url to the item, which would like to be available so that you just need to click on it and it will download to your phone)

2. I want the main menu of the site will be based on the TYPE table. e.g. the type table contains. 1.Games, 2.Ringtones, Links etc - so the main menu would read the information in the table and then display it on the phone.
the user would then click on any of the main menu items and it would take them to a list of items which match that link (e.g. if they click on the games link it would pass the typeid variable and then go to the results page and only show the items where the typeid match)

3. Once the user gets into the menu item (e.g.Games) it will display a list of all the games available (all java games - .jar files) the user can then just click on the link (the link comes from the database) and then download the item.

4. i would also like facility which would allow the user to search database (e.g. if they type the word bruce, it would bring back the reasons Bruce Lee fighting - Game, Bruce Springfield - Ringtone etc)

thats all i need to do.

i know how to do this using dreamweaver MX and the tools that come with it but this makes a ASP file with HTML formatting. to convert the HTML to WML seems very difficult after looking through a few help sites so i wanted to do it just using WML and ASP.  

What do you guys think? would it be easier to create the site in dreamweaver using the HTML stuff and then try and turn the HTML into WML.

or to just do it using for example santanabuilder or nokia tools to create the ASP with WML.

i'm trying to do this because i have alot of files that i would like to make available for my phone (my phone does not have an data cable available so its near impossible to get any ringtones or games etc for the phone)

the url for my wap site at the minute is

http://mototone.com/index.wml

(i want this to be a database driven wap site)

can anyone give any example codes which could help me?

or give me some links to places that could teach me how to do this?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Accepted Solution

by:
NeilT earned 465 total points
Comment Utility
Hi, here are the files you need to get it working

index.asp
catagory.asp
search.asp
searchResults.asp

Best wishes
Neil

---------------------------------------------------------------
index.asp


      <%
      thisDatabase = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("mototone.mdb") & ";"
      response.ContentType = "text/vnd.wap.wml"
      Response.Buffer = True
 
      set thisConn = Server.CreateObject("ADODB.Connection")
      thisConn.Open thisDatabase
      %>
      
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="start" title="Welcome">
<p align="center">MOTOTONE</p>

      <%
      strsql = "select * from [Type] ORDER BY [Type]"
      set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open strsql, thisConn, 1, 2
      'totalRecs = rs.RecordCount
      %>
<p>
<small>
      <%
      if rs.EOF then
      response.write "No Data"
      else
      Do While (NOT rs.EOF)
      %>
            <%
            strsqlCount = "select [ItemID] from [Item] WHERE Type=" & rs("TypeID")
            set rsCount = Server.CreateObject("ADODB.Recordset")
            rsCount.Open strsqlCount, thisConn, 1, 2
            totalRecs = rsCount.RecordCount      
            rsCount.Close
            Set rsCount = Nothing
            %>      
<a href="category.asp?cat=<% response.write rs("TypeID") %>"><% response.write rs("Type") %> (<% response.write totalRecs %>)</a>
<br/>
      <%
      rs.MoveNext
      Loop
      end if
      %>
</small>
</p>
      <%
      ' Close recordset and connection
      rs.Close
      Set rs = Nothing
      %>
      
<p>
<a href="search.asp">Search</a>
</p>
</card>
</wml>


      <%
      thisConn.Close
      Set thisConn = Nothing
      %>




------------------------------------------------------------
search.asp

<% response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
      <card id="Search" title="MOTOTONE" newcontext="true">
      
      <p align="center"><small>Search For:</small></p>
            <p align="center"><input name="Query"/></p>
            <do type="accept" label="Go">
                  <go href="searchResults.asp?value=$(Query)" />
            </do>
      </card>
</wml>


-----------------------------------------------------------

searchResults.asp

      <%
      thisDatabase = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("mototone.mdb") & ";"
      response.ContentType = "text/vnd.wap.wml"
      Response.Buffer = True
      searchCriteria = Request.QueryString("value")      
      set thisConn = Server.CreateObject("ADODB.Connection")
      thisConn.Open thisDatabase
      strsql = "select * from [Item] WHERE [Title] LIKE '%" & searchCriteria & "%' ORDER BY Title"
      set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open strsql, thisConn, 1, 2
      totalRecs = rs.RecordCount
      %>
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="SearchResults">
<p align="center"><small>mototone</small></p>
<p align="center"><b>R E S U L T S</b><br/></p>      
<p>
<small>
      <%
      if rs.EOF then
      response.write "No match for " & searchCriteria
      else
      Do While (NOT rs.EOF)
      %>
<a href="<% response.write rs("DownloadLink") %>"><% response.write rs("Title") %></a>
<br/>
<br/>
      <%
      rs.MoveNext
      Loop
      end if
      %>
</small>
</p>
</card>
</wml>
      <%
      rs.Close
      Set rs = Nothing
      thisConn.Close
      Set thisConn = Nothing
      %>


-------------------------------------------------------------------------------

category.asp


      <%       
      thisDatabase = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("mototone.mdb") & ";"
      response.ContentType = "text/vnd.wap.wml"
      Response.Buffer = True      
      cat = request.querystring("cat")
      set thisConn = Server.CreateObject("ADODB.Connection")
      thisConn.Open thisDatabase
      %>      
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="select" title="Welcome">
<p align="center">MOTOTONE</p>
      <%
      strsql = "select * from [Item] WHERE Type=" & cat
      'response.write strsql
      set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open strsql, thisConn, 1, 2
      %>
<p>
<small>
      <%
      if rs.EOF then
      response.write "No results for " & cat
      else
      Do While (NOT rs.EOF)
      %>                  
<a href="<% response.write rs("DownloadLink") %>"><% response.write rs("Title") %></a>
<br/>
      <%
      rs.MoveNext
      Loop
      end if
      %>
</small>
</p>
      <%
      ' Close recordset and connection
      rs.Close
      Set rs = Nothing
      %>
</card>
</wml>
      <%
      thisConn.Close
      Set thisConn = Nothing
      %>










0
 

Author Comment

by:MiamiDolphins
Comment Utility
Thanks again
0
 

Expert Comment

by:ahmadhilmi
Comment Utility
hi there..
i try to create a wap website.. the problem occured in order to link my site to database.. i already installed mysql and create a table for my site.. here is what i wrote for wml file:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>


<card id="register" title="Online Organizer">
<p>
User Name:
<input name="name" id= "name" />
</p>
</card>
</wml>

now my table in mysql is 'organizer' with contain the field called 'name'.. so how to pass the value inserted to my table.. i know nothing about php but i guess i need to use php to pass the value.. so can anyone plss help me..

0
 

Expert Comment

by:polleitor
Comment Utility
Hi
I am developing a basic wap application that uses ASP to connect to an Access database. The query is very simple, you just ask for the name of an employee and then it displays the names that match with the ones of the databse. I have almost everything done, but for some reason when I test it, it doesn allow me to establish the connection. I dont know if it is something not written correctly or something else. I would appreciate all the help possible. I am putting here the code of both the .wml and the .asp, so you can let me know whats wrong in an easier way:

search.wml

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="search" title="Search Employee">
<do type="accept" label="Go">
    <go href="employee.asp" method="post">
        <postfield name="name_emp" value="$name_emp"/>
    </go>
</do>
<p>
    Type the name of the employee:
    <input type="text" name="name_emp" value=""/>
</p>
</card>
</wml>
_________________________________________________

employee.asp

<% @ language="vbscript" %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<%
  Dim strname, rs, conn, sql
  Set conn = Server.CreateObject("ADODB.Connection")
  conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("daai.mdb")
  strnombre = Request.Form("name_emp")
  sql = "SELECT * FROM Employee WHERE Name = '"& strname&"'"
  Set rs = conn.Execute(sql)
%>
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="name_emp" title="Search Results">
<do type="prev" label="Back">
    <prev/>
</do>
<p>
<%  
        If rs.EOF Then
      Response.Write "No employees were found with the name of " &strNombre
       Else
                Response.Write "Employees with the name of " &strNombre& "<br/>"
        While NOT rs.EOF
      Response.Write &rs.Fields("Name").Value& "<br/>"
            Response.Write "---<br/>"
            rs.MoveNext
        Loop    
    rs.Close
    Set rs = Nothing
%>
</p>
</card>
</wml>


Thats it. Again, it would mean a lot to me if anyone can help me. Thanks.
0
 

Author Comment

by:MiamiDolphins
Comment Utility
<% @ language="vbscript" %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<%
  Dim strname, rs, conn, sql
  Set conn = Server.CreateObject("ADODB.Connection")
  conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("daai.mdb")
  strnombre = Request.Form("name_emp")
  sql = "SELECT * FROM Employee WHERE Name = '"& strnombre&"'"
  Set rs = conn.Execute(sql)
%>
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="name_emp" title="Search Results">
<do type="prev" label="Back">
    <prev/>
</do>
<p>
<%  
        If rs.EOF Then
     Response.Write "No employees were found with the name of " &strNombre
       Else
                Response.Write "Employees with the name of " &strNombre& "<br/>"
        While NOT rs.EOF
     Response.Write &rs.Fields("Name").Value& "<br/>"
            Response.Write "---<br/>"
            rs.MoveNext
        Loop    
    rs.Close
    Set rs = Nothing
%>
</p>
</card>
</wml>
0
 

Author Comment

by:MiamiDolphins
Comment Utility
<% @ language="vbscript" %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<%
  Dim strname, rs, conn, sql, strnombre
  Set conn = Server.CreateObject("ADODB.Connection")
  conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("daai.mdb")
  strnombre = Request.Form("name_emp")
  sql = "SELECT * FROM Employee WHERE Name = '"& strnombre&"'"
  Set rs = conn.Execute(sql)
%>
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="name_emp" title="Search Results">
<do type="prev" label="Back">
    <prev/>
</do>
<p>
<%  
        If rs.EOF Then
     Response.Write "No employees were found with the name of " &strNombre
       Else
                Response.Write "Employees with the name of " &strNombre& "<br/>"
        While NOT rs.EOF
     Response.Write &rs.Fields("Name").Value& "<br/>"
            Response.Write "---<br/>"
            rs.MoveNext
        Loop    
    rs.Close
    Set rs = Nothing
%>
</p>
</card>
</wml>
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now