Page 1 of 1

undefined variable in login script

Posted: Tue Feb 16, 2010 5:18 am
by kandarpmistry
<!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='' size='20' $Ctrid>
<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='' size='20' $pwd>
<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>

Error:PHP Notice: Undefined variable: Ctrid in F:\Kandarp\testing\DEASICREATIONSWEBSITE\translationlogin.php on line 41 PHP Notice: Undefined variable: pwd in F:\Kandarp\testing\DEASICREATIONSWEBSITE\translationlogin.php on line 50

Re: undefined variable in login script

Posted: Tue Feb 16, 2010 5:46 am
by rahulzatakia
Hi,

You have error in line 41,

<td><input type='password' name='Password' value='' size='20' $pwd>

what is $pwd there in input tag