A newbie style question, I'm afraid. I was wondering if someone might tell me what best practice is in the following situation.
Should it be...
function submitted_data()
{
//Testing user data
if(userdata != correctlyentered)
{
display_form(errors);
}
//Submit verified data to server
}
In which case, what's the correct syntax when calling display_form from within submitted_data, because at the moment it continues to submit the data to the server when I don't want it to.
Or should it be...
function submitted_data()
{
//Testing user data
if(userdata != correctlyentered)
{
display_form(errors);
}
else
{
//Submit verified data to server
}
}
Or does it not make any difference?
Thanks.