hi, im using a bouncer.php script to bump people off a page if they arent logged in. its not working. any help greatly appreciated. thanks. derek
here is the bouncer page
Code:
<?php
session_start();// this is a session start declaration call. to let us know we are using sessions on this page.
// when you create a session you create an actual file on server that it writes to.
/*echo '<pre>';
print_r($_SESSION);
echo '</pre>';
exit;*//// TO TEST OUTPUT DEBUGGING WHY IT WOULDNT LET ME LOG IN
if(!isset($_SESSION["userid"])){ // why would they be on this page if session is not set!!!! this code is a bouncer..a cop.
header("Location:index.php"); // if it hasnt been set and they are on this page, hack=y and redirect them back with the naught naughty message.
exit;
}
?>
and here is the page people are restricted from if not logged in
Code:
<?php
include("connect1.php");
include("bouncer.php"); // kicks the person off if session is not set, its the bouncer, big and fat man. ooooh.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>oldmastercopies.com</title>
<style type="text/css">
<!--
.style1 {
font-size: x-large;
font-weight: bold;
color: #009966;
}
-->
</style>
</head>
<body>
<div align="center">
<p>thank you for your purchase!</p>
<p class="style1">WELCOME TO OLDMASTERCOPIES.COM</p>
<p> </p>
<p><strong>OLD MASTER DRAWING TECHNIQUE SERIES</strong></p>
<p>VIDEO 1 "LINE, 3D SHAPE, AND PERSPECTIVE"</p>
<p>VIDEO LENGTH: 3 minutes 46 seconds</p>
<a href="drawing1.asx">Click here to play video</a>
<p> </p>
</div>
</body>
</html>
|