I'm trying to create a form that passes information within it self to validate if a field has been populated with information. Can any one point out why this code may not work?
Code:
{php}
if ($GLOBALS["HTTP_GET_VARS"]["B2"] == "Reset") echo "Reset";
$process = ($GLOBALS["HTTP_GET_VARS"]["B1"] == "Submit");
$ok = "ok";
$msg = "
There are errors:";
if ($process) {
// check first name FIRST_NAME
$firstname = ($GLOBALS["HTTP_GET_VARS"]["FIRST_NAME"]);
if ($firstname == '') {
$ok = 'not ok';
$msg .= "
First name cannot be blank";
}
} else {
$firstname = "";
}
{/php}
<form name="b1" action="{php} echo "$form"; {/php}" method="post">
{php}
if ($ok == 'not ok')
printf('<span class="error">%s</span>
', $msg);
{/php}
First Name
<input class="form3" size="30" name="FIRST_NAME" type=text value="{php} echo $firstname;{/php}">
<input type="submit" value="Submit" name="B1" class="button">
</form>