I have two documents. I"m just trying to validate one form. I want the error message to pop up but it's not. How do I do that for my code?
Document 1 "test.php"
<?php
@$fname=$_GET["fname"];
@$fnameerror=$_GET["fnameerror"];
?>
<html>
<h1>Entry Form </h1>
</html>
<?php
if (isset($fname)==True)
echo "$fnameerror="*"";
else
echo "$fnameerror=""";
?>
<form name="Stumarks" action="test2.php" method="get">
<p>First Name: <input type="text" name="fname" value="<?php echo $fname; ?>" /></input><font color="red"><?php echo $fnameerror; ?></font></p>
<input type="submit" value="Submit" />
</form>
Documetn 2 "test2.php":
<html>
<h1>Academic Report Card</h1>
</html>
<?php
$fname=$_GET["fname"];
$fnameerror=$_GET["fnameerror"];
If ($fname=="" or ctype_alpha($fname)== False)
{ header ("Location: test.php?fname=$fname&&fnameerror=$fnameerror");
else
echo "<table border=1>";
echo
"<th> <h2>".$fname." </h2> </th>
";
echo "</table>";
?>
Bookmarks