Weedpacket wrote:I'm not entirely clear what is being asked for. Are you saying that users may come back to this form sometime later after they have completed it, and you don't them to have to fill the form in again if they do? Using a [man]session[/man] variable may help in this case, which is set on completion to some particular value you can check for (you can store other data here as well, such as the submitted data itself).
I havent done a good job explaining the problem I was getting.
//Boolean Variables used to decide which fields need an error message to denote they havent keyed in a value for that mandatory field.
validatefield1
validatefield2
errmsg = false
if Submit button is empty
//No error messages appear on form
validatefield1 = false
validatefield2 = false etc..
else
//submit button is clicked
//Validate each mandatory field
If field1 is null, empty or contains no data
set validatefield1 = false
else
set validatefield1 = true
end if
Check each field...
end if
if validatefiled1 == true && validatefield2 == true etc
$errmsg = false
header('Location: gohere.php')
exit;
else
$errmsg = true
end if
My problem was that I had commented out the check to see if the errmsg was set, so my validation code kept appearing. ARGH!!! I thought it has something to do with my submit button not resetting itself or something along those lines. shake head
Are you suggesting using session variables? If so, what would be the reason for using that?
Should I be rethinking about the way I should be developing this page, if so, how?
Weedpacket wrote:Incidentally, you should follow
header('Location: gohere.php');
with a call to exit, because you want to stop this script from continuing (which it will do unless you tell it to stop).
Yes thankyou, i just forgot to add it here, but I have done that. 🙂
Weedpacket wrote:Conclusion: do both.
Unfortunately I cannot use javascript.
Thankyou very much for your help. 🙂