Learning PHP and MySQL

Example 04-06 Else and if statements

<?php
if  ($username  ==  "Admin"){
  
echo  ('Welcome  to  the  admin  page.');
}
else  {
  
echo  ('Welcome  to  the  user  page.');
}
?>

Posted by on 08/03 at 08:10 AM

Next entry: Example 04-07 Checking multiple conditions

Previous entry: Example 04-05 The multiplication is done last because of the override

<< Back to main