alpinhasov
03-12-2007, 12:08 AM
I have two pages. One is registration, and the other is validation to validate the input.
Register.php is as like this:
<form name="signup" action="validate.php" method="post">
<table width="751">
<tr>
<td width="78"><b>First Name</b></td>
<td width="185"><input type="text" name="fname" size="20" ></td>
<td width="79"><b>Last Name</b></td>
<td width="185"><input type="text" name="lname" size="20" ></td>
</tr>
</table>
<input type="submit" value="Continue>">
</form>
validate.php is as follows
<?php
//require("db.php");
$message="<b><font size=\"4\">Please enter your:</font></b> ";
$message= $message. "<font size=\"3\" color=\"#FF0000\">";
$returnValue = true;
//First name
if ($fname == "" || $fname == '')
{
$message = $message ."<b><br>First name";
$returnValue = false;
}
//Last name
if ($lname == "")
{
$message= $message . "<br>Last name ";
$returnValue = false;
}
if($returnValue)
{
session_start();
$_SESSION['fname'] = $fname ;
$_SESSION['lname'] = $lname ;
}
else
{
print("<html><head><link rel=\"stylesheet\" href=\"mystyles.css\" type=\"text/css\"><title>Data Validation</title></head>
<body class=\"validation\">");
print($message. "</font>");
print("<br><br><font size=\"3\" color=\"#0000FF\">Press the back button.</font></b>");
print("</body></html>");
}
It used to work before but stopped at some point. So even if I type the first name and last name it doesn't see it. Does anybody know why? Thank you.
Register.php is as like this:
<form name="signup" action="validate.php" method="post">
<table width="751">
<tr>
<td width="78"><b>First Name</b></td>
<td width="185"><input type="text" name="fname" size="20" ></td>
<td width="79"><b>Last Name</b></td>
<td width="185"><input type="text" name="lname" size="20" ></td>
</tr>
</table>
<input type="submit" value="Continue>">
</form>
validate.php is as follows
<?php
//require("db.php");
$message="<b><font size=\"4\">Please enter your:</font></b> ";
$message= $message. "<font size=\"3\" color=\"#FF0000\">";
$returnValue = true;
//First name
if ($fname == "" || $fname == '')
{
$message = $message ."<b><br>First name";
$returnValue = false;
}
//Last name
if ($lname == "")
{
$message= $message . "<br>Last name ";
$returnValue = false;
}
if($returnValue)
{
session_start();
$_SESSION['fname'] = $fname ;
$_SESSION['lname'] = $lname ;
}
else
{
print("<html><head><link rel=\"stylesheet\" href=\"mystyles.css\" type=\"text/css\"><title>Data Validation</title></head>
<body class=\"validation\">");
print($message. "</font>");
print("<br><br><font size=\"3\" color=\"#0000FF\">Press the back button.</font></b>");
print("</body></html>");
}
It used to work before but stopped at some point. So even if I type the first name and last name it doesn't see it. Does anybody know why? Thank you.