Jump to content

Redirect Loop


eaglelegend

Recommended Posts

Hi, on my club.php file, I am getting this when viewed on my site, through firefox.

 

Redirect Loop

 

     

 

     

     

     

 

     

       

       

 

         

 

Redirection limit for this URL exceeded.  Unable to load the requested page.  This may be caused by cookies that are blocked.

 

       

 

 

       

       

 

The browser has stopped trying to retrieve the requested item. The site is

 

redirecting the request in a way that will never complete.

 

 

 

 

    *  Have you disabled or blocked cookies required by this site?

 

 

    *  NOTE: If accepting the site's cookies does not resolve the problem, it is probably a server configuration

 

        issue and not your computer.

 

code as below;

 

<?php

/*

Club include (club.inc.php)

*/
$clubid = $_GET['clubid'];
mysql_query("UPDATE clubs2 SET hits = hits + 1 WHERE id = '$clubid' AND game = '$game'") or die (mysql_error());

$q = "SELECT * FROM clubs2 WHERE id = '$clubid' AND game = '$game'";$rs = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());$getclub = mysql_fetch_assoc($rs);
if (mysql_num_rows($getclub) == 0)
{
die(header(error("club.php?game=$game","This is not a real club.")));
}
$getmemberdata = fetch("SELECT * FROM club_members2 WHERE club = '$clubid' AND user = '$userid' AND game = '$game'");
$getmemberdata4 = fetch("SELECT * FROM club_members2 WHERE user = '$userid' AND game = '$game'");
if (!$getmemberdata[id])
{
$getmemberdata[position] = 0;
}
$clubrank = $getmemberdata[position];

if ($clubrank == 0)
{
$position = "Visitor, <a href=$base_url/club_join.pro.php?game=$game&clubid=$clubid><font color=$topAndBottomText>join</font></a>";
}

if ($clubrank == 1)
{
$position = "Member, <a href=$base_url/club_leave.pro.php?game=$game&clubid=$clubid onClick=\"if ( !confirm ('Are you sure you want to leave this club?') ) { return false; }\"><font color=$topAndBottomText>leave</font></a>";
}
if ($clubrank == 2)
{
$position = "Moderator, <a href=$base_url/club_leave.pro.php?game=$game&clubid=$clubid onClick=\"if ( !confirm ('Are you sure you want to leave this club?') ) { return false; }\"><font color=$topAndBottomText>leave</font></a>";
}
if ($clubrank == 3)
{
$position = "Admin";
$club_admin_line = "<br><a href=club_admin.php?game=$game&clubid=$clubid>Admin Page</a>";
}

if ($clubrank < $clubrank_check)
{
die(header(error("clubs.php?game=$game","You do not have access to this page.")));
}

$num_members = mysql_num_rows(mysql_query("SELECT id FROM club_members2 WHERE club = '$clubid' AND game = '$game'"));
echo '<pre>' . var_export($getclub,true) . '</pre>';
$date_created = date("M j, Y",$getclub['datecreated']);
$owner = fetch("SELECT display_name FROM members2 WHERE id = '$getclub[owner]' AND game = '$game'");

$numPosts = mysql_num_rows(mysql_query("SELECT id FROM club_forums2 WHERE club = '$clubid'"));

$topmenu = "
<center><table width=95% bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1><tr bgcolor=\"$topAndBottomBG\" width=100%><td><p><font color=$topAndBottomText><b>$getclub[name]</b> <i>owned by $owner[display_name]</i></font></p></td><td width=150><p><font color=$topAndBottomText>$display_name ($position)</font></p></td></tr><tr height=100 bgcolor=\"$reallyLight\"><TD colspan=2><p align=center><b><i>$getclub[motto]</i></b></p><center><table bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1 width=375><tr bgcolor=\"$topAndBottomBG\"><td width=50%><p align=center><b><font color=$topAndBottomText>Stats</font></b></p></td><td width=50%><p align=center><b><font color=$topAndBottomText>Links</font></b></p></td></tr><tr bgcolor=\"$reallyLight\"><td valign=top>

<p>Members: <a href=club_members.php?game=$game&clubid=$clubid>$num_members</a><br>
Created: $date_created<Br>
Hits: $getclub[hits]</p>

</td><td valign=top>

<p><a href=$base_url/club.php?game=$game&clubid=$clubid>Home</a><br>
<a href=$base_url/club_forums.php?game=$game&clubid=$clubid>Chat Boards</a> ($numPosts Posts)
$club_admin_line</p></td>

</tr></table><Br></center></td></tr></table>";

$startClub = "<Br>$topmenu<br><table width=95% bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1><tr bgcolor=\"$topAndBottomBG\"><td><p align=left class=white><b>$page_heading</b></p></td></tr><tr bgcolor=\"$maincellColor\"><td>";
$endClub = "</td></tr></table></center><br>";

?>

Link to comment
https://forums.phpfreaks.com/topic/132968-redirect-loop/
Share on other sites

ok I deleted die now, however it is still redirecting;

 

<?php

/*

Club include (club.inc.php)

*/
$clubid = $_GET['clubid'];
mysql_query("UPDATE clubs2 SET hits = hits + 1 WHERE id = '$clubid' AND game = '$game'") or die (mysql_error());

$q = "SELECT * FROM clubs2 WHERE id = '$clubid' AND game = '$game'";$rs = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());$getclub = mysql_fetch_assoc($rs);
if (mysql_num_rows($getclub) == 0)
{
header(error("club.php?game=$game","This is not a real club."));
}
$getmemberdata = fetch("SELECT * FROM club_members2 WHERE club = '$clubid' AND user = '$userid' AND game = '$game'");
$getmemberdata4 = fetch("SELECT * FROM club_members2 WHERE user = '$userid' AND game = '$game'");
if (!$getmemberdata[id])
{
$getmemberdata[position] = 0;
}
$clubrank = $getmemberdata[position];

if ($clubrank == 0)
{
$position = "Visitor, <a href=$base_url/club_join.pro.php?game=$game&clubid=$clubid><font color=$topAndBottomText>join</font></a>";
}

if ($clubrank == 1)
{
$position = "Member, <a href=$base_url/club_leave.pro.php?game=$game&clubid=$clubid onClick=\"if ( !confirm ('Are you sure you want to leave this club?') ) { return false; }\"><font color=$topAndBottomText>leave</font></a>";
}
if ($clubrank == 2)
{
$position = "Moderator, <a href=$base_url/club_leave.pro.php?game=$game&clubid=$clubid onClick=\"if ( !confirm ('Are you sure you want to leave this club?') ) { return false; }\"><font color=$topAndBottomText>leave</font></a>";
}
if ($clubrank == 3)
{
$position = "Admin";
$club_admin_line = "<br><a href=club_admin.php?game=$game&clubid=$clubid>Admin Page</a>";
}

if ($clubrank < $clubrank_check)
{
die(header(error("clubs.php?game=$game","You do not have access to this page.")));
}

$num_members = mysql_num_rows(mysql_query("SELECT id FROM club_members2 WHERE club = '$clubid' AND game = '$game'"));
echo '<pre>' . var_export($getclub,true) . '</pre>';
$date_created = date("M j, Y",$getclub['datecreated']);
$owner = fetch("SELECT display_name FROM members2 WHERE id = '$getclub[owner]' AND game = '$game'");

$numPosts = mysql_num_rows(mysql_query("SELECT id FROM club_forums2 WHERE club = '$clubid'"));

$topmenu = "
<center><table width=95% bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1><tr bgcolor=\"$topAndBottomBG\" width=100%><td><p><font color=$topAndBottomText><b>$getclub[name]</b> <i>owned by $owner[display_name]</i></font></p></td><td width=150><p><font color=$topAndBottomText>$display_name ($position)</font></p></td></tr><tr height=100 bgcolor=\"$reallyLight\"><TD colspan=2><p align=center><b><i>$getclub[motto]</i></b></p><center><table bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1 width=375><tr bgcolor=\"$topAndBottomBG\"><td width=50%><p align=center><b><font color=$topAndBottomText>Stats</font></b></p></td><td width=50%><p align=center><b><font color=$topAndBottomText>Links</font></b></p></td></tr><tr bgcolor=\"$reallyLight\"><td valign=top>

<p>Members: <a href=club_members.php?game=$game&clubid=$clubid>$num_members</a><br>
Created: $date_created<Br>
Hits: $getclub[hits]</p>

</td><td valign=top>

<p><a href=$base_url/club.php?game=$game&clubid=$clubid>Home</a><br>
<a href=$base_url/club_forums.php?game=$game&clubid=$clubid>Chat Boards</a> ($numPosts Posts)
$club_admin_line</p></td>

</tr></table><Br></center></td></tr></table>";

$startClub = "<Br>$topmenu<br><table width=95% bgcolor=\"$tableOutline\" cellpadding=0 cellspacing=1><tr bgcolor=\"$topAndBottomBG\"><td><p align=left class=white><b>$page_heading</b></p></td></tr><tr bgcolor=\"$maincellColor\"><td>";
$endClub = "</td></tr></table></center><br>";

?>

Link to comment
https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691491
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.