Skip to content

Instantly share code, notes, and snippets.

@thomasdegry
Created May 25, 2014 14:08
Show Gist options
  • Save thomasdegry/1576baadd75aa2798baf to your computer and use it in GitHub Desktop.
Save thomasdegry/1576baadd75aa2798baf to your computer and use it in GitHub Desktop.
<?php
if(!empty($_SESSION["isAdmin"])):
?>
<a href="addProduct.php">Add Product</a>
<?
endif;
?>
----
<?php
if(empty($_SESSION["isAdmin"]) {
header('Location: home.php?message=noAdmin');
}
?>
--- home.php ----
<?php
if(!empty($_GET["message"] && $_GET["message"] == "noAdmin")):
?>
<div class="error-message">
<p>U heeft geen toegang tot deze pagina als u geen admin bent</p>
</div>
<?php
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment