WAP login "easy way"

Hello I have played little bit with a wml using wml editor 3.0 and testing it with openwave mobile simulator.
What is the most easy way to implement login support. It means that I want to ask user for ID and password on the first wml card and when it is correct, application should jump to card 2.???? can anyone help me... Thanks
mirzaabdicAsked:
Who is Participating?
 
cwkhangCommented:
if you need to make use of database (id and password store in database), u need to use web language like asp, php, jsp.
if you don't need any database, tat can be implemented with the help of wmlscript.
0
 
mirzaabdicAuthor Commented:
Hello cwkhang

Yes i dont need any database implementation. wmlscript is ok....any idea how to do that....????
thanks in advance
0
 
cwkhangCommented:
u need this two files - signin.wml and validate.wmls
valid userid is abcd and valid password is 123
hope these are useful for you. gd luck!

signin.wml
=======

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

<wml>

<card id="login" title="Login">
<p>
Username:
<do type="accept">
<go href="#pass"/>
</do>
<input name="login"/>
</p>
</card>
<card id="pass">

<p>
Password:
<do type="accept">
<go href="validate.wmls#validate()"/>
</do>
<input type="password" name="pass" />
</p>
</card>
<card id="empty">
<p>Username or Password is empty!</p>
<do type="accept">
<go href="#login"/>
</do>
</card>

<card id="badlogin">
<p>Authentication failed!</p>
<do type="accept">
<go href="#login"/>
</do>
</card>

<card id="Ok" title="New Page">
<p>
Welcome $(login)!
</p>
</card>
</wml>



validate.wmls
=========

extern function validate()
{
var login=WMLBrowser.getVar("login");
var pass=WMLBrowser.getVar("pass");
var tempid="abcd";
var temppwd="123";

var compid=String.compare(login,tempid);
var comppwd=String.compare(pass, temppwd);

if ((String.isEmpty(login))||(String.isEmpty(pass))) {
WMLBrowser.go("signin.wml#empty");
}
else if ((comppwd!=0)||(compid!=0)){
WMLBrowser.go("signin.wml#badlogin");
}
else {
WMLBrowser.go("signin.wml#Ok");
}
}
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
mirzaabdicAuthor Commented:
Thanks...   my WML files are running on tomcat server in root. And they are working.
But i have a last Q. Thsi 2 files u provided do they just have to be in the same root directory and they will work????
0
 
mirzaabdicAuthor Commented:
Thanks a lot it is working afte I changed a little bit in my MIME types on tomcat server...
U rule
0
 
touchringCommented:
Why dun you consider letting the user send a login SMS to the server, and then WAP Push the login link to the request MSISDN?  

This is by far the most secure method and also the most convenient to the end user.

Rgds,
Joshua Lim
Visualtron Software
http://www.sms-gateway-software.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.