The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

URGENT>...Login script problem

2 posters

Go down

URGENT>...Login script problem Empty URGENT>...Login script problem

Post by tcwsl February 22nd 2010, 10:39 am

I am designing a page for login using a simple javascript
when I run the page in my computer, the page successfully displayed, but when I enter the right userID and password, the window doesn't directed to the location student_home.htm

I'm sure that I get the student_home.htm in the same directory
What's wrong? Hope pros can help coz it is an absolutely urgent task...

I want to ask how to add more "account" as well
I mean what should I write in the if-else script? (I am a js-idiot)

Here is the code
Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta http-equiv="content-style-type" content="text/css" />
<link rel="stylesheet" href="css/lc.css" type="text/css" />
<link rel="shortcut icon" href="img/favicon.ico">
<title>Welcome to Learning Cube</title>
</head>
<body>
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="student") {
if (form.pass.value=="student") {             
location="student_home.htm"
} else {
alert("Invalid Password")
}
} else {  alert("Invalid UserID")
}
}
//-->
</script>
<center>
<fieldset style="-moz-border-radius:8px;text-align:left;width:55%">
<Legend>
<img src="img/logo.png" width="150" height="44"/>
</Legend>
<table align="center" cellspacing="2" cellpadding="1" border="0">
<tr>
<td align="center"><font size="2">LearningCube is an E-learning Package designed to learn Chinese, English and Mathematics in Primary standard</font>
  <hr width="70%" \>
<img src="img/signin.png" width="128" height="128"></td>
<td width="1" bgcolor="#D0D0D0"></td>
<td><form name="login">
<table cellpadding="12" border="0">
<tr>
   <td colspan="2"><font size="+1">Sign in <em>LearningCube</em></font></td>
</tr>
<tr>
   <td><center><Label><b>UserID:</b></Label></center></td>
   <td><input name="id" type="text" /></td>
</tr>
<tr>
   <td><center><Label><b>Password:</b></Label></center></td>
   <td><input name="pass" type="password"></td>
</tr>
<tr>
   <td colspan="2"><center><input src="img/login.png" type="image" onClick="pasuser(this.form)"></center></td>
   
</tr>
</table>
</form></td>
</tr>
</table>
</fieldset>
</center>
</body>
</html>
avatar
tcwsl
Forumember

Male Posts : 149
Reputation : 10
Language : Chinese, English

http://lastforumonearth.the-talk.net/

Back to top Go down

URGENT>...Login script problem Empty Re: URGENT>...Login script problem

Post by tcwsl February 22nd 2010, 11:23 am

any help?

I'm so sorry but can you help me? Embarassed


Last edited by tcwsl on February 22nd 2010, 11:44 am; edited 1 time in total
avatar
tcwsl
Forumember

Male Posts : 149
Reputation : 10
Language : Chinese, English

http://lastforumonearth.the-talk.net/

Back to top Go down

URGENT>...Login script problem Empty Re: URGENT>...Login script problem

Post by Sanket February 22nd 2010, 11:42 am

May I remind you that double/triple posting isn't tolerated unless separated by 24 hours (Use the edit button) Wink
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum