<?php session_start();
// For register_global on PHP settings
$member = $_COOKIE['member'];
if (empty($member) || !isset($member)) // fail to read the browser cookie
{
// Try to read session
if (empty($_SESSION['member']) || !isset($_SESSION['member']))
{
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
<img src="images/lay_01.gif" width="1024" height="241">
</div>
<div id="nav">
<table cellspacing=0 cellpadding=0 width="136" border="0">
<tr>
<td width="136" height="29" background="images/nav_01.gif"> </td>
</tr>
<tr>
<td background="images/nav_02.gif"><?php include("navinfo.php")?> </td>
</tr>
</table>
</div>
<div id="fr">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500" height="29" background="images/fr_01.gif"> </td>
</tr>
<td width="500" height="8" background="images/fr_03.gif"><form action="membership/login.php" method="post">
<table width="100" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><div align="center">Username:</div></td>
<td><div align="center">
<input name="name" type="text" id="name" maxlength="30">
</div></td>
</tr>
<tr>
<td><div align="center">Password:</div></td>
<td><div align="center">
<input name="password" type="password" id="password" maxlength="10">
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
<td> <div align="center">
<input type="submit" name="submit" value="Login">
<input type="reset" name="reset" value="Reset">
</div></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
</body>
</html>
<?php
}
else
{
header("Location: index2.php"); // redirect user to login
exit;
}
}
?>
The first bit of my code works however if the session exists it wont redirect ot index2.php it just stays blank
The url is
http://www.jami3.co.uk/splintercell/login.php
username:admin
password:password
then it will redirect you to index2 however reload login.php and it wont redirect you..
do you know why?
thanks
btw to logout you can go to http://www.jami3.co.uk/splintercell/membership/logout.php