Currently, I am working in my project. I tried to create a login page for using SDK 5.1. By login is no problem but only there is problem when trying to search or copmpare for the userid and password. Can any expert please help. Below is my Wap asp program. Thanks
Login.asp
<%@ Language = "JScript"; %><% Response.ContentType = "text/vnd.wap.wml";
%><?xml version="1.0"?>
<!-- #include file="adojavas.inc" -->
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"
http://www.wapforum.org/DTD/wml_1.2.xml">
<wml>
<card id="card1" title="Login">
<p>
UserID: <input type="text" name="UserID" maxlength="8"/>
Password:<input type="password" name="Password" maxlength="8"/>
<do type="accept" label="Login">
<go href="check.asp" method="post" >
<postfield name="UserID" value="$(UserID)" />
<postfield name="Password" value="$(Password)" />
</go>
</do>
</p>
</card>
</wml>
After I have key in all the UserID and Password, the login pay will direct me to check.asp. The screen will prompt"HTTP error:500" Can please enlighten me. Here is the asp as follows:
check.asp
<%@ Language = "JScript"; %><% Response.ContentType = "text/vnd.wap.wml";
%><?xml version="1.0"?>
<!-- #include file="adojavas.inc" -->
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"
http://www.wapforum.org/DTD/wml_1.2.xml">
<wml>
<card id="card1" title="Verify">
<p>
<%
Dim conn, rs
Set conn = Server.CreateObject("ADODB
.Connectio
n")
Set rs = Server.CreateObject("ADODB
.Recordset
")
'---Opens the connection to the database---
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=" & Server.MapPath("Login.mdb"
) & ";"
'---Retrieve the user record
sql = "SELECT * FROM Users WHERE UserID='"
& Request.Form("UserID") & "' AND Password='" &
Request.Form("Password") & "'"
Set rs = conn.Execute (sql)
if rs.EOF then
'---means UserID and Password do not match---
Response.Write "Invalid Login"
else
Response.Write "Welcome, " & rs.Fields("Name")
end if
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
%>
</p>
</card>
</wml>