I'm writing PHP to understand it. This isn't for a project, just trying to understand and write IF, FORMS and all that jazz.
Here is the problem though. This PHP works. BUT then again it doesn't...
if you type something in and then hit the submit button, it goes to a blank screen (suppose to refresh the page its on and post a message). If you hit back on the browser (the form is still filled out) and hit submit again, IT THEN show you the result. I can't see what is making that happen. maybe someone could help me out.
<?php
if ($submit){
if (!empty($_POST['workplace'])){
if ($_POST['workplace'] == ("the store shop")){
echo "you do belong";
}else {
echo "you do not belong here, please leave";
}
} else {
echo "Please Fill Out Form";
}
}
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<br>Put in your place of work<br><input type="text" name="workplace" size="24"><input type="submit" name="submit" value="click me" border="0">
</form>
thanks for you help.
-JB-