eaglelegend Posted November 16, 2008 Share Posted November 16, 2008 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/ Share on other sites More sharing options...
redarrow Posted November 16, 2008 Share Posted November 16, 2008 but what this all mean die(header(error("clubs.php?game=$game","You do not have access to this page."))); very starange to me your using die then do somethink how that work strange format...... Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691478 Share on other sites More sharing options...
DeanWhitehouse Posted November 16, 2008 Share Posted November 16, 2008 The die function cannot be used like that , it can print on the screen but not use header in die, its like using header in echo. Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691482 Share on other sites More sharing options...
eaglelegend Posted November 16, 2008 Author Share Posted November 16, 2008 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691491 Share on other sites More sharing options...
DeanWhitehouse Posted November 16, 2008 Share Posted November 16, 2008 die(header(error("clubs.php?game=$game","You do not have access to this page."))); It is still there and what is error(); function. Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691493 Share on other sites More sharing options...
eaglelegend Posted November 16, 2008 Author Share Posted November 16, 2008 it is to display if the club dont exsit shows "This club dont exist" Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691494 Share on other sites More sharing options...
DeanWhitehouse Posted November 16, 2008 Share Posted November 16, 2008 Well without seeing the function code we can't help much. Quote Link to comment https://forums.phpfreaks.com/topic/132968-redirect-loop/#findComment-691498 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.