Redirect Loop.

Status
Not open for further replies.

Olly_

Active Member
Oct 21, 2011
142
37
Hey guys, I uploaded a index.php for my hotel, and it was working perfectly untill I became across a redirect loop, i've tryed restarting apache/mysql but it still wont work.. Here's the php.
PHP:
<?php
require_once('./includes/core.php');
require_once('./includes/session.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title><?php echo SHORTNAME; ?>: <?php echo $page['name']; ?></title>
 
<script type="text/javascript">
var andSoItBegins = (new Date()).getTime();
</script>
    <link rel="shortcut icon" href="<?php echo PATH; ?>/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="alternate" type="application/rss+xml" title="<?php echo SHORTNAME; ?>: RSS" href="<?php echo PATH; ?>/articles/rss.xml" />
 
<script src="<?php echo PATH; ?>/web-gallery/static/js/libs2.js" type="text/javascript"></script>
 
<script src="<?php echo PATH; ?>/web-gallery/static/js/landing.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/local/com.css" type="text/css" />
 
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/frontpage.css" type="text/css" />
 
<style type="text/css">
body {background-color: }
</style>
 
<script type="text/javascript">
document.habboLoggedIn = false;
var habboName = null;
var ad_keywords = "";
var habboReqPath = "<?php echo PATH; ?>";
var habboStaticFilePath = "<?php echo PATH; ?>/web-gallery";
var habboImagerUrl = "<?php echo PATH; ?>/habbo-imaging/";
var habboPartner = "";
var habboDefaultClientPopupUrl = "<?php echo PATH; ?>/client";
window.name = "habboMain";
if (typeof HabboClient != "undefined") { HabboClient.windowName = "client"; }
 
</script>
 
 
<meta name="description" content="Join the world's largest virtual hangout where you can meet and make friends. Design your own rooms, collect cool furniture, throw parties and so much more!" />
<meta name="keywords" content="virtual, world, join, groups, forums, play, games, online, friends, teens, collecting, social network, create, collect, connect, furniture, virtual, goods, sharing, badges, social, networking, hangout, safe, music, celebrity, celebrity visits, cele" />
 
<!--[if IE 8]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie8.css" type="text/css" />
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie.css" type="text/css" />
<![endif]-->
 
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie6.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/pngfix.js" type="text/javascript"></script>
<script type="text/javascript">
try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
</script>
 
<style type="text/css">
body { behavior: url(<?php echo PATH; ?>/web-gallery/js/csshover.htc); }
</style>
<![endif]-->
<meta name="build" content="PHPRetro 4.0.17 Custom V1" />
</head>
<body id="frontpage">
 
<div id="fp-container">
    <div id="header" class="clearfix">
        <h1><a href="<?php echo PATH; ?>/"></a></h1>
        <span class="login-register-link">
                  </span>
    </div>
 
                       
                <div class="habblet-container ">   
 
 
   
 
<br>
<br>
<br><br>
<br>
<br><br>
<br>
<br>
<div class="cbb loginbox clearfix">
    <h2 class="title">Sign in</h2>
    <div class="box-content clearfix" id="login-habblet">
 
        <form action="<?php echo PATH; ?>/account/submit" method="post" class="login-habblet">
                        <ul>
                <li>
                    <label for="login-username" class="login-text">Username</label>
                    <input tabindex="1" type="text" class="login-field" name="username" id="login-username" value="" maxlength="32" />
                </li>
                <li>
                    <label for="login-password" class="login-text">Password</label>
 
                    <input tabindex="2" type="password" class="login-field" name="password" id="login-password" maxlength="32" />
                    <input type="submit" value="Sign in" class="submit" id="login-submit-button"/>
                    <a href="#" id="login-submit-new-button" class="new-button" style="margin-left: 0;display:none"><b style="padding-left: 10px; padding-right: 7px; width: 55px">Sign in</b><i></i></a>
                </li>
                <li id="remember-me" class="no-label">
                    <input tabindex="3" type="checkbox" value="true" name="_login_remember_me" id="login-remember-me" checked="unchecked"/>
                    <label for="login-remember-me">Remember me</label>
 
                </li>
 
                <li id="register-link" class="no-label">
                    a>
                </li>
                <li class="no-label">
                    <a href="<?php echo PATH; ?>/register" class="login-register-link"><span>Register for free</span></a>
                </li>
            </ul>
 
<div id="remember-me-notification" class="bottom-bubble" style="display:none;">
 
    <div class="bottom-bubble-t"><div></div></div>
    <div class="bottom-bubble-c">
                By selecting 'remember me' you will stay signed in on this computer until you click 'Sign Out'. If this is a public computer please do not use this feature.    </div>
    <div class="bottom-bubble-b"><div></div></div>
</div>
        </form>
 
    </div>
 
 
                <div class="habblet-container ">
<BR>       
   
                       
<div class="cbb" id="hotel-stats"><ul class="stats">
    <li class="stats-online"><span class="stats-fig">0</span> <?php echo SHORTNAME; ?>s online now</li>
    <li class="stats-online"><?php echo SHORTNAME; ?> Hotel is <span class="stats-fig">online</span></li>
 
</div>
 
</div>
</div>
 
 
<script type="text/javascript">
L10N.put("authentication.form.name", "Username");
L10N.put("authentication.form.password", "Password");
HabboView.add(function() {LoginFormUI.init();});
HabboView.add(function() {window.setTimeout(function() {RememberMeUI.init("newfrontpage");}, 100)});
</script>
 
 
 
                       
                   
                </div>
                <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
           
 
                       
                <div class="habblet-container ">       
   
                        <div id="frontpage-image" </div>
 
    <script type="text/javascript">
    var sb = new SpeechBubble();
    var i = 0;
    sb.add("fp-bubble-"+i++, "frontpage-image", -47.5, -250, "..Sign in or register for free!!.. :D");
    HabboView.add(function() {sb.render();});
    </script>
 
 
                       
   
   
                        <div class="logincontainer">
 
 
                                    </div>
 
               
                           
           
</div>
 
<div style="position: fixed; top: 20px; right: 5px;">
<div class="cbb loginbox clearfix">
<center>
<font size="2" color="grey">
Enter the client immediately!
<br>
<a href="<?php echo PATH; ?>/client">
<img src="http://img135.imageshack.us/img135/3364/habbologinlogo.gif" />
 
</font>
<br>
<font size="-2" color="grey">
<p>Ripped by <a href="http://forum.*****.com/members/845355.html">Rajito @ *****</a> from <a href="http://<?php echo SHORTNAME; ?>productions.org/"><?php echo SHORTNAME; ?>Retro</a>
<br></P>
</font>
</center>
</div>
<div>
<p><script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'all'
  }
}).render().setUser('lrajitol').start();
</script>
</div>
</div>
</div>
 
                       
                   
                </div>
                <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
 
</div>
<div style="position: fixed; top: 20px; right: 5px;">
 
<a href="http://www.facebook.com/pages/YOURFACEBOOKPAGE=wall"> <img src="http://img121.imageshack.us/img121/8608/necc.gif" title="<?php echo SHORTNAME; ?> on Facebook" border="0"></a>
</div>
</div>
<div style="position: fixed; top: 56px; right: 5px;">
<a href="vip.php"><img src="http://img853.imageshack.us/img853/3489/vip.gif" title="Buy VIP" border="0"></a>
</div>
</div>
</div>
 
 
<!--[if lt IE 7]>
<script type="text/javascript">
Pngfix.doPngImageFix();
</script>
<![endif]-->
 
<div id="footer">
</div>            </div>
        </div>
 
<script type="text/javascript">
HabboView.run();
</script>
 
 
</body>
</html>
 
           
 
</div>
<script type="text/javascript">
Pngfix.doPngImageFix();
</script>
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
The only thing I can possibly think of is that either core.php or session.php contain redirects that keep making index.php go to another page, then that page goes back to index.php then it keeps doing it, your browser then recognises the chain of redirects and throws an error.
 

Olly_

Active Member
Oct 21, 2011
142
37
PHP:
<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/
 
if (!defined("IN_HOLOCMS")) { header("Location: ".PATH."/"); exit; }
 
if($settings->find("site_allow_guests") != "0"){
    $page['allow_guests'] = false;
}
 
if($user->error > 2){
    $errornum = $user->error;
    if($errornum == 3){
        header('Location: '.PATH.'/account/logout?reason=banned'); exit;
    }
    $user->destroy();
    header('Location: '.PATH.'/?error='.$errornum);
    exit;
}
 
if(!isset($_SESSION['user']) && $page['allow_guests'] != true){
    if(!isset($page['dir'])){ $_SESSION['page'] = $_SERVER["REQUEST_URI"]; }
    if(strrpos($_SESSION['page'],"client") != false){ header("Location: ".PATH."/login_popup"); }else{ header("Location: ".PATH."/"); } exit;
}elseif(!isset($_SESSION['user']) && $page['allow_guests'] == true){
    if(!isset($page['dir'])){ $_SESSION['page'] = $_SERVER["REQUEST_URI"]; }
}
if(!empty($page['rank'])){
    $u = $serverdb->fetch_row($core->select3($id));
    if($u[3] < $page['rank']){
        $user->error = 4;
    }
}
if($user->ip != $_SERVER['REMOTE_ADDR']){
    $user->error = 5;
}
if(time() > ($user->time + (((int) $settings->find("site_session_time")) * 60))){
    $_SESSION['reauthenticate'] = true;
    $user = new HoloUser($user->name,$user->password,true);
    $_SESSION['user'] = $user;
}
 
?>
 
Status
Not open for further replies.

Users who are viewing this thread

Top