RevCMS redirection question

Results 1 to 4 of 4
  1. #1
    Enthusiast Gin0 is offline
    MemberRank
    Apr 2013 Join Date
    35Posts

    RevCMS redirection question

    Hi, I'm using RevCMS and I'm trying to have a code in my client.php which redirects anyone who is above rank 5 to a .php page once they go to client.php

    I'm using this in the top of my client.php, but it doesn't work.

    <?php

    if($_SESSION['user']['rank'] >= 5 ) { ?><a href="http://myhotel.com/hi.php"

    ?>

    If anyone can fix my code please do!


    Thanks a lot, btw here's my client.php and tell me where I'm suppose to put it.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>{hotelName} - Client</title>

    <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/client.css" type="text/css">

    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/swfobject.js"></script>
    <script type="text/javascript">
    var BaseUrl = "{swf_folder}";
    var flashvars =
    {
    "client.starting" : "Hotel is loading .. please wait",
    "client.allow.cross.domain" : "1",
    "client.notify.cross.domain" : "0",
    "connection.info.host" : "IP",
    "connection.info.port" : "port",
    "site.url" : "{url}",
    "url.prefix" : "{url}",
    "client.reload.url" : "{url}/client",
    "client.fatal.error.url" : "{url}/me",
    "client.connection.failed.url" : "{url}/me",
    "external.variables.txt" : "{external_vars}",
    "external.texts.txt" : "{external_texts}",
    "productdata.load.url" : "{product_data}",
    "furnidata.load.url" : "{furni_data}",
    "use.sso.ticket" : "1",
    "sso.ticket" : "{sso}",
    "processlog.enabled" : "0",
    "flash.client.url" : BaseUrl,
    "flash.client.origin" : "popup"
    };
    var params =
    {
    "base" : BaseUrl + "/",
    "allowScriptAccess" : "always",
    "menu" : "false"
    };
    swfobject.embedSWF(BaseUrl + "/Habbonew.swf", "client", "100%", "100%", "10.0.0", "{swf_folder}/expressInstall.swf", flashvars, params, null);
    </script>



    </head>

    <body>

    <div id="client"></div>

    </body>

    </html>


  2. #2
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: RevCMS redirection question

    Try this:

    PHP Code:
    <?php
    if($_SESSION['user']['rank'] >= 5) { 
        
    header("Location: http://myhotel.com/hi.php"); 
        exit(); 
    }
    ?>

  3. #3
    Proficient Member NoOne96 is offline
    MemberRank
    Jul 2013 Join Date
    173Posts

    Re: RevCMS redirection question

    <?php
    if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) < 5)
    {
    header("location: http://127.0.0.1/me"); // Url where it gets redirected
    }
    ?>

    Enjoy

  4. #4
    LETS REACH 666 POSTS?!!!! ImNotSatan is offline
    MemberRank
    Apr 2013 Join Date
    google.devLocation
    573Posts

    Re: RevCMS redirection question

    Quote Originally Posted by NoOne96 View Post
    <?php
    if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) < 5)
    {
    header("location: http://127.0.0.1/me"); // Url where it gets redirected
    }
    ?>

    Enjoy
    Wow thid is messy O_O

    i agree with Sledmore:

    <?php
    if($_SESSION['user']['rank'] >= 5) {
    header("Location: http://myhotel.com/hi.php");
    exit();
    }
    ?>



Advertisement