|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ASP db connection with WML
Need someone to check my codes if its correct. Cos I really know nothing much about ASP and WML and there's error in loading ALL my ASP files on Nokia Mobile Browser. My ASP file and database(db.mdb) are located at C:/Inetpub/wwwroot. Did I declare the path for connection correctly?
Is it possible to have the link "Login" once clicked, the user input information will also be sent over and without having it in a <do> having to click Options then send the info? Many thanks to those who can help me.. The code for my first file: <%Response.ContentType="text/vnd.wap.wml"%> <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"> <wml> <card id="login" title="Login Page"> <onevent type="onenterforward"> <refresh> <setvar name="userid" value=""/> <setvar name="pw" value=""/> </refresh> </onevent> <p align = "center"> Please enter User ID and Password.<br/> User ID : <input type="text" name="userid" maxlength="10"/><br/> Password : <input type="password" name="pw" maxlength="10"/> <br/> <a href="#validate">Login</a> | <a href="#login">Reset</a> </p> <do type="accept" label="Login"> <go method="get" href="#validate"> <postfield name="loginID" value="$(userid)"/> <postfield name="password" value="$(pw)"/> </go> </do> </card> <card id="validate" title="Login Page"> <% Dim rs Dim sql, userID, passwd userID=Request.QueryString("loginID") passwd=Request.QueryString("password") Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "DRIVER={Microsoft Access Driver(*.mdb)}; DBQ=" & Server.MapPath("db.mdb") sql = "select * from UserProfile where ID='" & userID & "' and password='" & passwd & "'" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, objConn if NOT rs.EOF then %> userid=<%=userid%> password=<%=passwd%> <do type="accept"> <go href="welcome.asp"/> </do> <% } else %> <p align="center">Invalid Username or Password<br/> userid=$(userid)<br/> <br/> <a href="login.asp">Re-Login again</a> </p> <% end if rs.Close Set rs = Nothing conn.Close Set conn = Nothing %> </card> </wml> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > ASP db connection with WML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|