WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 11th, 2004, 10:46 PM
wai2324 wai2324 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 8 wai2324 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > ASP db connection with WML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway