php - Is IF obligatory to be followed by ELSE -
i not sure if if must followed else in example above or if if can used alone without else. page show if there no else? beginner...
<?php $rank = $user["rank"]; if ($rank != 'admin'){ header('location: get_the_he.._out.php'); exit(); } else { ?> <html> <head><title>show page</title></head> <body> here show page if user admin </body> </html> <?php } ?>
no. there no need have else if. need make sure script not continue after if, doing here :)
Comments
Post a Comment