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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 12th, 2005, 09:25 AM
ji4hui ji4hui is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 23 ji4hui User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 49 sec
Reputation Power: 0
Passing data from wml to wmlscript to asp

Hi all..

I'm having a problem with the passing of data from my wml page >> wmlscript >> asp.

What my codes wants to do is to allow user to enter their login ID and password in the wml (login.wml). After the user clicks on the submit link, it will go to wmlscript(verification.wmls) to validate if the password user entered is less then 5 characters. If it's true, then it will go to the asp page (login.asp) where it will check if the user id and password is valid from my Acceess Database. If it's true, it will re-direct the user to my mainPage (main.wml) else, it will display an error message.

The problem i have now is I cant seem to be able to pass the UserID and password the user entered from the wmlscript to my asp. Here's my codes:

login.wml
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"> 

<wml>
<card id = "index" title = "Bookstore WAP Site">
  <do type="accept" label="Login">
       	<go href="http://localhost:8810/WMLAssignment/verification.wmls#VerifyPassword()"/>
   </do>
<p align="center">
<big><b>Login Page</b></big>
<br/>
	User ID: <input name = "UserID" value = ""/>
<br/>
	Password: <input type="password" name = "Password" value = ""/>
</p>

</card>
</wml>


verification.wmls
Code:
extern function VerifyPassword()
{
	var inputID = WMLBrowser.getVar("UserID");
	var inputPwd = WMLBrowser.getVar("Password");

	if((String.length(inputID) == 0) || (String.length(inputPwd) == 0))
		Dialogs.alert("Please Enter Your ID and/or password!!!");

	else if (String.length(inputPwd) > 5 )
		Dialogs.alert("Invalid input! Password should not exceed more than 5 characters.");

	else
		WMLBrowser.go("http://localhost:8810/WMLAssignment/login.asp?userID=$(inputID)&password=$(inputPwd)");	
}


login.asp
Code:
<% 
    Dim conn, rs
    Dim userID, password

    userID = Request.QueryString("userID") 
    password= Request.QueryString("password") 
	
	response.Write(userID)
	response.Write(password)

    Set conn = Server.CreateObject("ADODB.Connection")                         
    Set rs   = Server.CreateObject("ADODB.Recordset")                          
    conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("wml.mdb") & ";"                                         
  
    sql = "SELECT * FROM member WHERE name='"& userID &"' AND password='"&password &"'" 
       
    Set rs = conn.Execute (sql) 
	
	                                               
    
    if rs.EOF then                                                             
        response.Write("You have entered a wrong userID/password. Please re-enter.")                                   
    else
        response.redirect("main.wml")                                
    end if
    rs.Close                                                                   
    conn.Close                                                                 
    Set rs = Nothing                                                           
    Set conn = Nothing                                                         
%>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Passing data from wml to wmlscript to asp


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 3 hosted by Hostway