Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2005
    Posts
    724
    Tokens
    0

    Default Stupid variables! HELP! :(

    Need some help with this:

    Code:
    <?PHP
    $staff_ips[1] = "84.71.128.117"; 
    $staff_ips[2] = "84.71.128.118"; 
    if($staff_ips[1] != $_SERVER['REMOTE_ADDR']){ 
    die("You are not authorised to view this Page."); 
      else if($staff_ips[2] != $_SERVER['REMOTE_ADDR']){ 
    die("You are not authorised to view this Page."); 
    } 
    } 
    ?>
    I get this error: Parse error: syntax error, unexpected T_ELSE in /home/habbo06/public_html/security/log_ip.php on line 9

    Its probbably a stupid mistake
    Last edited by Jae; 04-08-2006 at 10:25 PM.
    Starting webdesign again.

  2. #2
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    <?PHP
    $staff_ips[1] = "84.71.128.117";
    $staff_ips[2] = "84.71.128.118";
    if($staff_ips[1] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }else if($staff_ips[2] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }
    ?>

    altho i dont think that script would work anyway, coz its saying is its not the first one, and not the second one its not authorises. But an IP cant be both
    Last edited by Eric30; 05-08-2006 at 12:09 PM.

  3. #3
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    <?php
    $staff_ips[1] = "84.71.128.117";
    $staff_ips[2] = "84.71.128.118";
    if($staff_ips[1] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }else if($staff_ips[2] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }
    ?>

    and yeah, both IP's are blocked.. It will work if your trying to make an IP Ban thing, is that what your doing?

  4. #4
    Join Date
    Dec 2005
    Posts
    724
    Tokens
    0

    Default

    Its to say if a ip isnt the one in $staff_ip[1] or$staff_ip[2] it will block them
    Starting webdesign again.

  5. #5
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    Well from what i can see it is saying if the IP is one of them it won't let them see it.

  6. #6
    Join Date
    Dec 2005
    Posts
    724
    Tokens
    0

    Default

    != means not equal mate
    Starting webdesign again.

  7. #7
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    Mhmm ok.

    Edit: LMAO @ UR SIG.
    Last edited by PixelResources; 05-08-2006 at 02:37 PM.

  8. #8
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    Im still not sure,

    lets say my IP was 84.71.128.117

    if it is not 84.71.128.117 then its ok
    if its not 84.71.128.118 (which it isnt) then 'You are not authorised to view this Page'

    See what i mean? That script doesnt seem logicaly right. Please say if it works or not

    <?PHP
    $staff_ips[1] = "84.71.128.117";
    $staff_ips[2] = "84.71.128.118";
    if($staff_ips[1] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }else if($staff_ips[2] != $_SERVER['REMOTE_ADDR']){
    die("You are not authorised to view this Page.");
    }
    ?>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •