user login script not running

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kandarpmistry
Forum Newbie
Posts: 8
Joined: Sat Feb 13, 2010 11:28 pm

user login script not running

Post by kandarpmistry »

Code: Select all

<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<body background="querybackground.jpg">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="font-family:times; color:black; font-size:20px; text-align:center">CUSTOMER LOGIN</p>
<p style= text-align:"center">
<?php 
function validateOnSubmit()
{
 $errs= True;
 if (strlen($Ctrid) < 6 || strlen($Ctrid) > 12 && $Ctrid != NULL)
  {
   $errs = False;
   echo "alert('Please enter user id of length greater than or equal to 6 characters and less than or equal to 12 characters')"; 
 }
 if (strlen($pwd) < 6 || strlen($pwd) > 12 &&  $pwd != NULL) 
  { 
   $errs = False;
   echo "alert('Please enter password of length greater than or equal to 6 characters and less than or equal to 12 characters')"; 
  }
 if ($Ctrid == NULL && $pwd == NULL) 
  {
   $errs = False;   
   echo "alert('Please fill the required categories before submitting')";
  }
 return $errs;
}
echo '<form name="translation_login_input" onsubmit="return validateOnSubmit()" action="translationorder.htm" method="get">
<table>
<tr>
<td><p style="font-family:times; color:black; font-size:20px; text-align:center">Customer id</p></td>
<td><p style="font-family:times; color:black; font-size:20px; text-align:center">:</p></td>
<td><input type="text" name="Customerid" value="" $Ctrid size="20">
<br></td>
</tr>
<tr>
<td><p style="font-family:times; color:black; font-size:20px; text-align:center">Password</p></td>
<td><p style="font-family:times; color:black; font-size:20px; text-align:center">:</p></td>
<td><input type="password" name="Password" value="" $pwd size="20">
<br></td>
</tr>
</table>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</p>
<p style="font-family:times; color:black; font-size:20px; text-align:center">If you are a new customer, <a href="newcustomerlogin.htm">please follow this link...</a></p>
';
?>
</body>
</html>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: user login script not running

Post by Christopher »

Your script is in PHP and runs on the server. It will no be present in the browser. The onSubmit event calls Javascript.
(#10850)
Post Reply