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!


Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default Can only enter site from certain URL.

    Hey there, is there like a PHP script to stop people coming from somewhere else such as just from typing the url into the browser. But only able to view the site if they were directed from another page on the site.

    If you could tell me if this is possible and where I could find code to do this, then that would be great.

    - T.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    Hey there, is there like a PHP script to stop people coming from somewhere else such as just from typing the url into the browser. But only able to view the site if they were directed from another page on the site.

    If you could tell me if this is possible and where I could find code to do this, then that would be great.

    - T.
    yh

    $_SERVER[HTTP_REFERER]

  3. #3
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    Quote Originally Posted by Jackboy View Post
    yh

    $_SERVER[HTTP_REFERER]
    PHP Code:
    <?php

    if($_SERVER[HTTP_REFERRER] == "url") {

    page here

    }else{
    exit(
    "Access Denied");
    }
    ?>
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  4. #4

    Default

    But be aware people can quite easily spoof it.

  5. #5
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    If you want it to allow someone who was directed from any url it would be:

    if( $_SERVER[HTTP_REFERRER] == NULL ) {
    . die('soz no access');\

    } else {

    }


    Vouches
    [x][x]

  6. #6
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    Quote Originally Posted by Iszak View Post
    But be aware people can quite easily spoof it.
    Any like security I could add, ect?
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  7. #7
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    Sorry for double post, but the limit has just expired!
    None of the above seem to work for me, and what I want is like;

    if( $_SERVER[HTTP_REFERRER] == "pagea.php" ) {
    SHOW THE PAGE, otherwise..
    } else {
    exit("Sorry, you need to follow the correct url.");
    }
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  8. #8
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by TomSpit View Post
    Sorry for double post, but the limit has just expired!
    None of the above seem to work for me, and what I want is like;

    if( $_SERVER[HTTP_REFERRER] == "pagea.php" ) {
    SHOW THE PAGE, otherwise..
    } else {
    exit("Sorry, you need to follow the correct url.");
    }
    I think it has to be an absolute url. If that still doesn't work try changing $_SERVER[HTTP_REFERRER] to $_SERVER['HTTP_REFERRER']. There is no way of stopping it from being spoofed. You could add a cookie on pagea.php and check for it on pageb.php instead.
    Last edited by Jxhn; 04-01-2009 at 08:59 AM.

  9. #9
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    If you're serious about this I would try to HTTP referrer method and the cookie method - that way people will only get through if they can really be bothered



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  10. #10
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    KK thanks.
    Thread closed.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


Page 1 of 3 123 LastLast

Posting Permissions

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