Login a refresh, PHP script popup If statement in JS dialog box
if ((Isset ($_post[' user ') &&$_post[' user ']== ' panus ') && (isset ($_post[' password ']) &&$_ post[' password ']== ' welcome '))
{
Setcookie ("Dlcookie", "OK");
echo "";
}
else{
echo "";
}
Why a refresh will also pop up (account or password Error) JS dialog box?? What should be changed?
------Solution--------------------
Submit to this page? You refresh once equals to re-execute the file, not meet the IF condition, of course, into the Else branch.
------Solution--------------------
There is a problem with the business logic of the code, it should be written like this:
PHP Code
if (Isset ($_post[' user ')) && isset ($_post[' password ')) { if ($_post[' user '] = = ' Panus ' && $_post[' Password '] = = ' welcome ') { Setcookie ("Dlcookie", "OK"); echo ""; } else echo "";}
------Solution--------------------
It is best to write the PHP code to another page for processing, to avoid automatic submission when the page refreshes. You can learn about MVC