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 10 of 10
  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default [TUT] Hidden page with PHP

    This tut will show how to make a simple hidden page in PHP, its useful for things like proxy websites.

    First of all you need to start a session. The amount of times the page has been refreshed will be stored in a session so it doesn't get lost when the page is refresh.
    PHP Code:
    <?php
    session_start
    (); //starting the session
    ?>
    Now you need to set how many times you want the page to be refreshed before the content appears.
    PHP Code:
    <?php
    session_start
    (); //starting the session
    $refresh 3//amount of times the page should be refreshed

    ?>
    I've added comments to the rest of the code so you know what it does
    PHP Code:
    <?php
    session_start
    (); //starts the session
    $refresh 3//amount of times the page should be refreshed

    if( $_SESSION['hidden'] != $refresh ) { //checks if the data in the session is the same as the $refresh var
         
    if( isset( $_SESSION['hidden'] ) ) { //checks if the session to store the page refreshes has been made
              
    $_SESSION['hidden']++; //adds 1 to the number in the session
         
    }
         else { 
    //if the session to store the page refreshes is not set
              
    $_SESSION['hidden'] = 1//makes $_SESSION['hidden']
         
    }
         exit( 
    "This is a maths site" ); //if $_SESSION['hidden'] was not the same as $refresh this will be displayed
    }
    ?>
    Now once you have done that save it as a .php file (EG: hidden.php). For all the pages you want hidden add this code to the top of the page.
    PHP Code:
    <?php
    include( "hidden.php" );
    ?>
    Enjoy


    Can a mod move this to the tuts forum please
    Lets set the stage on fire, and hollywood will be jealous.

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

    Latest Awards:

    Default

    Excellent tutorial, and very useful. Thanks.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  3. #3
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    May I ask what use this is for exactly? A real life example please. Not being a **** or anything sorry.
    Hi, names James. I am a web developer.

  4. #4
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    Excellent tutorial, and very useful. Thanks.
    Thanks
    Quote Originally Posted by Protege View Post
    May I ask what use this is for exactly? A real life example please. Not being a **** or anything sorry.
    You could use it to hide a proxy (so like you see a maths site, then you refresh the page and it turns into a proxy.) I use a similar script to hide a page with lists of games on which are unblocked in my school. So its mainly for hiding things.
    Lets set the stage on fire, and hollywood will be jealous.

  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Ahh good idea, nice script well done
    Hi, names James. I am a web developer.

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

    Latest Awards:

    Default

    This idea was originally from Luckyrare (Danny) for the Uploadz Proxy. By saying that, I am not having a go at you, you have just as much of a right to post it as anyone else.



    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)


  7. #7
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    mhmm, I see where the usage of this could come in handy but wouldn't it be easier to put a text box and a submit button and just if

    if ($_POST['boxname'] == 'roflfjfjgjgutjfjr') {
    echo("gamessite");
    } else {
    echo("maths site");
    }


  8. #8
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    is there a way to make the exit( have an include in it ?

    [X] [X] [X]

  9. #9
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    PHP Code:
     <?php 
    session_start
    (); //starts the session 
    $refresh 3//amount of times the page should be refreshed 

    if( $_SESSION['hidden'] != $refresh ) { //checks if the data in the session is the same as the $refresh var 
         
    if( isset( $_SESSION['hidden'] ) ) { //checks if the session to store the page refreshes has been made 
              
    $_SESSION['hidden']++; //adds 1 to the number in the session 
         

         else { 
    //if the session to store the page refreshes is not set 
              
    $_SESSION['hidden'] = 1//makes $_SESSION['hidden'] 
         

         include( 
    "includ" ); //shows an include if not refreshed 3 times
    } else {
         include( 
    "" ); //the thing to incude after 3 times
    }
    ?>
    Thats waht you would do pazza....


    www.fragme.co = a project.

  10. #10
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    PHP Code:
     <?php 
    session_start
    (); //starts the session 
    $refresh 3//amount of times the page should be refreshed 

    if( $_SESSION['hidden'] != $refresh ) { //checks if the data in the session is the same as the $refresh var 
         
    if( isset( $_SESSION['hidden'] ) ) { //checks if the session to store the page refreshes has been made 
              
    $_SESSION['hidden']++; //adds 1 to the number in the session 
         

         else { 
    //if the session to store the page refreshes is not set 
              
    $_SESSION['hidden'] = 1//makes $_SESSION['hidden'] 
         

         include( 
    "includ" ); //shows an include if not refreshed 3 times
    } else {
         include( 
    "" ); //the thing to incude after 3 times
    }
    ?>
    Thats waht you would do pazza....
    Oh thanks

    +rep to you and decode

    [X] [X] [X]

Posting Permissions

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