Jump to content

Unusual cookie issue


SirChick

Recommended Posts

This is a new error for me and it really doesnt make too much sense...

 

Firstly my code:

 

<?
include ("homeloginvariables.php");
?>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>British Jail</title>
</head>
<body bgcolor="#FFAD5B" text="#000000" style="scrollbar-face-color:#C8E8F8;scrollbar-arrow-color:#000000;scrollbar-3dlight-color:#C8E8F8;scrollbar-darkshadow-color:#404040;scrollbar-highlight-color:#E8F4FF;scrollbar-shadow-color:#40B0E8;scrollbar-track-color:#E8F4FF;">
<div id="bv_" style="position:absolute;left:233px;top:290px;width:430px;height:32px;z-index:3" align="center">
<font style="font-size:13px" color="#000000" face="Arial"><b>You are in jail! You must wait till you are released until you can continue your normal Civilian Life!</b></font></div>
<div id="bv_" style="position:absolute;left:294px;top:193px;width:280px;height:16px;z-index:4" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><u>Time In Jail:</u> <b><?= $TimeInJail ?></b></font></div>
<img src="Banner1.jpg" id="Image1" alt="" align="top" border="2" width="996" height="96" style="position:absolute;left:0px;top:0px;width:996px;height:96px;border-color:#FFFFFF;z-index:5">
<div id="bv_" style="position:absolute;left:216px;top:366px;width:472px;height:150px;z-index:6" align="left">
<form name="" method="POST" action="breakoutofjail.php" enctype="text/plain" id="Form1">
<input type="submit" id="Button1" name="BreakOut" value="Try To Break Out" style="position:absolute;left:158px;top:57px;width:144px;height:24px;z-index:0">
<div id="bv_Text2" style="position:absolute;left:158px;top:92px;width:150px;height:16px;z-index:1" align="center">
<font style="font-size:13px" color="#000000" face="Arial"><i>Costs 10 Courage!</i></font></div>
<input type="checkbox" id="Checkbox1" name="BreakOutCheckBox" value="" style="position:absolute;left:324px;top:58px;z-index:2">
</form>
</div>
</body>
</html>

 

 

Now what happens when i load this page is this :

 

The page isn't redirecting properly 

 

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

*  This problem can sometimes be caused by disabling or refusing to accept

          cookies.

 

 

Now what i find odd is this is the only page doing it the rest of the site is working dandy. But this code isn't any thing special... and that include is used on many of my pages... Ive not seen this error before.. and im confused as to why its even occurring :S

 

 

This is what is doing the redirect:

 

If ($Jail == 1) {
Header    ("Location: britishjail.php");
}

Link to comment
Share on other sites

Ok herers the code: sorry about the quote tags.

 

 

<?


include ("include.php");

// Start up the session

if (!isset($_SESSION['Current_User']) || !$_SESSION['Current_User']) {
die('You must be logged in to view this page');
}

// Get the user's info from the database by putting
// the user id stored in the session into the WHERE clause
$GetUserID = mysql_query("SELECT * FROM userregistration
				WHERE UserID='{$_SESSION['Current_User']}'");

// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetUserID))) {
echo "User not found!";
exit;
}




// Display user's info
$Username = $row["Username"];
$UserId = $row["UserID"];
$HandMoney = $row["MoneyInHand"];


//HOUSE STUFF

$GetHouseInfo = mysql_query("SELECT * FROM houses
				WHERE UserID='{$_SESSION['Current_User']}'");

// Fetch the row from the database
If (!($houserow = mysql_fetch_assoc($GetHouseInfo))) {
echo "House not found!";
exit;
}



$HouseNumber = $houserow['HouseNumber'];
$HouseType = $houserow['HouseType'];
$StreetName = $houserow['StreetName'];
$Area = $houserow['Area'];

$Rented = $houserow['Rented'];

If ($Rented == 0){
$HouseStatus = 'Owner';
}Else{
$HouseStatus = 'Lodger';
}

//COUNTRY NAME OBTAIN


$City = $row['CityID'];


$GetCityName = mysql_query("SELECT * FROM cities
				WHERE CityID='$City'");

// Fetch the row from the database
if (!($cityrow = mysql_fetch_assoc($GetCityName))) {
echo "User not found!";
exit;
}

$CityName = $cityrow['CityName'];
$CountryID = $cityrow['CountryID'];

$GetCountryName = mysql_query("SELECT * FROM countries
				WHERE CountryID='$CountryID'");

// Fetch the row from the database
if (!($countryrow = mysql_fetch_assoc($GetCountryName))) {
echo "User not found!";
exit;
}

$CountryName = $countryrow['CountryName'];




//JAIL CHECK

// Fetch the row from the database
$GetJail = mysql_query("SELECT * FROM jail
				WHERE UserID='{$_SESSION['Current_User']}'");

$jailrow = mysql_fetch_assoc($GetJail);

$TimeInJail = $jailrow['Time'];



?>

Link to comment
Share on other sites

oops i thought i had used code tags.. my bad.

 

Um include:

 

<?
session_start();
//this block of code is called up with an include command on the html page that the user displays
$connect = mysql_connect("localhost", "root", "private");

//error handle
if (!$connect) {
echo "Unable to connect to DataBase: " . mysql_error();
exit;
}

//error handle
if (!mysql_select_db("dbname")) {
echo "Unable to select dbname: " . mysql_error();
exit;
}
// Start up the session

if (!isset($_SESSION['Current_User']) || !$_SESSION['Current_User']) {
die('You must be logged in to view this page');
}

// Get the user's info from the database by putting
// the user id stored in the session into the WHERE clause
$GetUserID = mysql_query("SELECT * FROM userregistration
                    WHERE UserID='{$_SESSION['Current_User']}'");

                  
// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetUserID))) {
    echo "User not found!";
    exit;
echo mysql_error();
}


$GetJailInfo = mysql_query("SELECT * FROM jail
				WHERE UserID='{$_SESSION['Current_User']}'");

// Fetch the row from the database
$jailrow = mysql_fetch_assoc($GetJailInfo);

$Jail = $jailrow["JailID"];

If ($Jail == 1) {
Header    ("Location: britishjail.php");
}




?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.