i am using php post requests for restricting access to certain pages to my website.
here's the function that calls for access check
here's the page that should be displayed when access is denied
the problem is that whenever the page no_access.php is displayed some random characters are displayed on the screen
click here to view the page
here's the function that calls for access check
PHP:
require('accesscontrol.php');
$page_access_level=1;
check_access_status($page_access_level);
PHP:
//accesscontrol.php
if(!isset($_SESSION['uid']))
{
require('post_request.php');
$var_arr=array('status'=>'1');
//$no_access=no_access.php
list($header,$contents)=post("/".$no_access,$var_arr);
echo "$contents";
exit();
}
break;
here's the page that should be displayed when access is denied
PHP:
//no access.php
<?php
//require_once('accesscontrol.php');
//session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> NO ACCESS</title>
<link rel="stylesheet" type="text/css" href="layout.css"/>
<link rel="stylesheet" type="text/css" href="head.css"/>
<link rel="stylesheet" type="text/css" href="menu.css"/>
<link rel="stylesheet" type="text/css" href="register.css"/>
</head>
<body>
<div class="head" id="head" >
<h1>ACCESS DENIED</h1>
</div>
<div id="user_status">
<?php
require('source_link.php');
require_once("$user_status");
disp_status();
?>
</div>
<div id="left">
<?php
require_once('navigation.php');
$thisPage="home";
menu($thisPage);
?>
</div>
<div class="content" id="right">
<p>
<h3></h3>
<?php
if($_POST['status']==1)
{
echo"\n<br/>Please login to view this page";
}
else
{
echo"\n<br/>you are not logged in or do not have enough privileges to view this page";
}
?>
</p>
</div>
</body>
</html>
the problem is that whenever the page no_access.php is displayed some random characters are displayed on the screen
click here to view the page