Jump to content

The page isn't redirecting properly....


pneudralics

Recommended Posts

When I go to index.php which requires header.php I get the below error. The header.php requires the verify_login.php. I don't understand why I'm getting the below error.

 

I get the following error in firefox:

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.

 

/functions/verify_login.php

<?php
function verify_login()
{

//Check to see if cookie is set
if (isset($_COOKIE['id']) && isset($_COOKIE['ip']) && isset($_COOKIE['uniqueid'])){

$cookieid = $_COOKIE['id'];
$cookieip = $_COOKIE['ip'];
$cookieuniqueid = $_COOKIE['uniqueid'];

//Select id and loginip according to cookie uniqueid	
$query = "SELECT * FROM admin_user WHERE uniqueid = '$cookieuniqueid' LIMIT 1";

if ($result = mysql_query ($query)) {
	while ($row = mysql_fetch_array ($result)) {
	$id = $row['id'];
	$uniqueid = $row['uniqueid'];
	$ip = $row['ip'];	
	}
}
}
else {
header('Location: index.php');
}

//Compare cookies with database
if ($_COOKIE['id'] != $id && $_COOKIE['ip'] != $ip && $_COOKIE['uniqueid'] != $uniqueid) {
//Redirect to index if cookie compare fails
header('Location: index.php');
}

}//End function
?>

 

header.php

<?php 
require('../connect.php');
require('functions/verify_login.php'); 
verify_login();
?>
blahblah html goes here

 

 

index.php

<?php
require('header.php');
?>
blah
<?php
require('footer.php');
?>

Link to comment
https://forums.phpfreaks.com/topic/188960-the-page-isnt-redirecting-properly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.