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
    Nov 2006
    Location
    Boro
    Posts
    841
    Tokens
    1,650

    Latest Awards:

    Default Website Help - PHP Trouble

    Hi there. Didnt want to use iframes on this layout so i tried to you the (include) command.

    I have set it up here: http://74.81.64.58/~slwot/new_layout.php

    The links in the top right work, they open in the include box, but as you will probably be able to see, there is a few errors in the middle.

    Just wondering how to get rid of these errors if possible, or have i done it the wrong way.

    Thanks, Sam!
    Last edited by Bonxy; 10-09-2009 at 04:40 PM.
    *hi*


    Edited by Bonxy



  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Isn't that Tumblr's (old) design?

  3. #3
    Join Date
    Nov 2006
    Location
    Boro
    Posts
    841
    Tokens
    1,650

    Latest Awards:

    Default

    Yep it tis
    *hi*


    Edited by Bonxy



  4. #4
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    You are trying to open nothing. All you have is pages/.php

    ?

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    I recommend that you add a bit of security to the file includer...http://74.81.64.58/~slwot/new_layout.php?get=../new_layout

  6. #6
    Join Date
    Nov 2006
    Location
    Boro
    Posts
    841
    Tokens
    1,650

    Latest Awards:

    Default

    Lol.. I dont know

    Alls i want is for the links to open in that space, like they do when you click one of them, but i dont want any of them errors to be there if thats possible.

    Is there a different way i do it to make the pages open by using

    Http://www.bonxy.net/index.php?page=help

    Thanks, samŽ
    *hi*


    Edited by Bonxy



  7. #7
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    I recommend that you add a bit of security to the file includer...http://74.81.64.58/~slwot/new_layout.php?get=../new_layout
    Lmao bare jokes. umm just make sure u check if the page exists on your server or something.

  8. #8
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Apart from it does, it includes the same file over which results in a infinite loop.

    Quote Originally Posted by BoyBetterKnow View Post
    Lmao bare jokes. umm just make sure u check if the page exists on your server or something.

  9. #9
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    Apart from it does, it includes the same file over which results in a infinite loop.
    Yeh I mean like a page that is allowed in his system.

    Sorry I was tired earlier. @threadstarter, I'll explain what I mean.

    If you're doing the pages from db then check database if the page exists.

    If not then do like

    PHP Code:
    <?php

    $page 
    $security->secureString($_GET['page']);

    if (
    $page == 'home.php'){

    echo 
    'homepage';

    }else if (
    $page == 'about.php'){

    echo 
    'about.php';

    }
    etc. Secure the $page like i did if you're using it with db..

  10. #10
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Make sure your website has PHP5.
    PHP Code:
    <?php
    // File include by Blob off of HabboxForum
    $config = array("default" => "home.php"// Default Page (with trailing .php)
                    
    "directory" => "pages/"// Directory where files are held (with trailing slash)
                    
    "restricted" => array( "index" ), // Restricted pages
                    
    "404" => "404.php" // Error Page (with trailing .php)
                    
    );
    $page str_replace("/""", ( ( ( in_array$_GET["page"], $config["restricted"] ) ) !== false ) ? "home" $_GET["page"] ) );
    file_exists$config["directory"] . $page ".php" ) !== false ) ? include( $config["directory"] . $page ".php" ) : include( $config["directory"] . $config["404"] ); 
    ?>
    Pages Directory
    Replace "pages/" with the directory where the pages are contained from the index.php (so if your viewing the folder with index.php and theres a folder in there called hello with the pages in there, change it to "hello/")

    404 Page
    Replace "404.php" with your 404 page WITHIN the folder that you have said it your pages directory (make sure it has .php on the end) (it can be the same as your default page)

    Default Page
    Replace "home.php" with the default page you want to show when someone tries to access a restricted page or when no page is specified (make sure it has .php on the end)

    Restricted Pages
    PHP Code:
    "restricted" => array( "index" ), // Restricted pages 
    With the restricted pages, within the array( "index" ) put your extra restricted pages in that array, so if I don't want someone to access index.php and lol.php WITHIN the pages directory I would put:
    PHP Code:
    "restricted" => array( "index""lol" ), // Restricted pages 
    (Only putting index is only useful when your default directory is where index.php is, to stop an infinite loop).

Posting Permissions

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