samedi 14 avril 2018

Return error after input is incorrect

So I have a form. Lets say the form has an input named "uid". Just under neath that I have an empty variable called $warning. This is what I'm attempting to do on submit (in PHP):

if ($uid != $uidcheck) {
$warning = 'UID is incorrect';
return;
}

However the $warning variable which is now defined isn't showing anything, it's just stopping. I'm aiming to basically do the check, and if the UID is incorrect, go back to the page and display an error which is defined in the $warning variable.

Aucun commentaire:

Enregistrer un commentaire