the first is a page for registerd users only the 2nd page is guest access
<?
define('_IN_JOHNCMS', 1);
$textl = 'what' ; //Page title
$rootpath = '' ; // If u use file in sub folder $rootpath = '../'
$headmod = 'what';
//$lng_profile = core::load_lng('temp'); //Use this by removing // at start this will specify the lang file to use
require_once ("incfiles/core.php");
require_once ("incfiles/head.php");
// here we throw guest access an error
if (!$user_id) {
echo functions::display_error('Only for Registered Users');
require('incfiles/end.php');
exit;
}
//$act is the sction command
$act = isset($_GET['act']) ? $_GET['act'] : '';
switch ($act)
{
case "menu": // page start
echo '<div class="phdr">Hi ' . ($user_id ? '<b>' . $login . '</b>!' : $lng['guest'] . '!') . '</div>';
break; // page end
case "1":
break;
case "2":
break;
default; //set the default of the page
echo '<div class="phdr">Page Title</div>';
echo '';
echo '<a href="templogged.php?act=menu">Title</a>' ;
}
require('incfiles/end.php'); // page footer
?>
here is the page for guest access
<?php
define ( '_IN_JOHNCMS' , 1 );
$textl = 'what' ;
$rootpath = '' ;
$headmod = 'what';
//$lng_profile = core::load_lng('temp'); //Use this by removing // at start this will specify the lang file to use
require_once ("incfiles/core.php");
require_once ("incfiles/head.php");
if (empty( $_SESSION [ 'ref' ])) {
$_SESSION [ 'ref' ] = htmlspecialchars ( $_SERVER [ 'HTTP_REFERER' ]);
}
switch ( $act ) {
case 'info' :
echo '<div class="phdr">Page Title</div>';
echo 'Your text or links<br/>' ;
echo '<br/>' .
(isset($_GET['err']) || $headmod != "mainpage" || ($headmod == 'mainpage' && $act) ? ' <div class="phdr">Back to where ' . ($user_id ? '<b>' . $login . '</b>?' : $lng['guest'] . '?') . '</div> ' : '') .
($user_id ? '<a href="' . $set['homeurl'] . '/users/home.php?act=menu">Home</a>' : '<a href="' . $set['homeurl'] . '/index.php">Home</a>') .
'<br/><br/>';
echo '<a href="' . $_SESSION [ 'ref' ] . '">Back</a>' ;
break;
default;
echo '<div class="phdr">Page Title</div>';
echo '';
echo '<a href="test.php?act=info">Title</a>' ;
}
require_once ("incfiles/end.php" ); //Ноги сайта
?>