Hi,
i am using the CMS provided by the tutorial on this site and its working great.
Now, as im pretty new to php i have a question:
The restriction code that you put in your pages you want only logged in users to view, can i be used for link restriction aswell?
The restriction code:
Code:
<?php
require_once('../includes/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ header("Location: something.php"); die(); }
?>
Example:
<?php
require_once('../includes/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ echo "<a href='admin.php'>Admin</a>" }
?>
i cant get that to work, is it because the code can only be used at the start of the document? (before <html>) as i am putting it in a <div> in body.
Thanks in advance.