Hi ...,
I'm really new at this.
I've been trying to figure out how to repopulate a form after it has failed due to a validation problem. I've looked at dozens of posts, but none of the solutions that I have seen work for me.
Perhaps it's my code ... here it is very cut down and simplified, but it still doesn't work.
<! File name: MyForm.html>
<html>
<head>
</head>
<body>
<form action="validatepart.php" method="post">
Username: <input name="user" type="text">
<input type="submit" value="DO IT!!">
</form>
</body>
</html>
<! file name: validatepart.php>
<?php
$local=$_POST["user"];
// Code here to validate $local, returns $localOK either true or false.
// Assume that .....
$localOK=false;
if(!$localOK ==true) // local username is not allowed
{
include("MyForm.html"); // Return to MyForm
echo "OOps, made an error";
exit();
}
?>
I return to the form OK, but it isn't populated. Where am I going wrong?
G-fer