Creating the Login Page


The loginpage.html file creates the login page to help end users login as existing users. Listing 5-3 shows the contents of the loginpage.html file:

Listing 5-3: The loginpage.html File

start example
 <HTML> <HEAD> <TITLE>Login Page</TITLE> <SCRIPT language="javascript"> function openwindow(pagename,windowname) {    if(document.loginform.username.value=="")    {       alert('User name is a required field.');       return false;    }    if(document.loginform.username.value=="")    {       alert('Password is a required field.');       return false;    }    user_name=document.loginform.username.value;    pwd=document.loginform.password.value;    pagename=pagename+"?username="+user_name+"&password="+pwd;    window.open(pagename,windowname,'width=470,height=515,left=300,top=100,screenX=30,screenY=100');    this.close(); } </SCRIPT> </HEAD> <BODY> <FORM NAME="loginform"> <TABLE WIDTH="100%" ALIGN="CENTER"> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%" colspan=2> <FONT SIZE="4" COLOR=""> Enter your user name and password to login </FONT> </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%"> &nbsp; </TD> <TD WIDTH="45%"> &nbsp; </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%"> User Name </TD> <TD WIDTH="45%"> <INPUT TYPE="input" NAME="username" VALUE="" maxlength="100">  </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%"> Password </TD> <TD WIDTH="45%"> <INPUT TYPE="password" NAME="password" VALUE="" maxlength="100">  </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%"> &nbsp; </TD> <TD WIDTH="45%"> &nbsp; </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> <TR> <TD WIDTH="10%"> &nbsp; </TD> <TD WIDTH="45%"> &nbsp; </TD> <TD WIDTH="45%"> <INPUT TYPE="BUTTON" NAME="okbutton" style="width:100" VALUE="OK" onclick="javascript:openwindow('chathtml.html','chat');"> </TD> <TD WIDTH="10%"> &nbsp; </TD> </TR> </TABLE> </FORM> </BODY> </HTML> 
end example

Download this listing.

The loginpage.html page creates the login page, as shown in Figure 5-4:

click to expand: this figure shows the login page that allows existing end users to login..
Figure 5-4: The Login Page




Developing Applications Using Jabber
Developing Applications Using Jabber
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 68

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net