lundi 3 juillet 2017

How to compare strings in php ifelse?

I was comparing two string in my php page, but i am getting the following error when i run this page:

Parse error: syntax error, unexpected '"welcome sir!!"' (T_CONSTANT_ENCAPSED_STRING) in ***/login.php on line 7

<?php
$usern = $_POST["uname"];
$passw = $_POST["psw"];
$a = "admin";
$b = "guest";
if ($usern == $a) {
ehco "welcome sir!!";
}
elseif ($usern == $b) {
ehco "welcome new sir!!";
}
else {
echo "Wrong Username or Password";
}
?>

Aucun commentaire:

Enregistrer un commentaire