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 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Dfiles.co.cc

  1. #11
    Join Date
    Jul 2007
    Location
    UK
    Posts
    2,470
    Tokens
    2,975

    Latest Awards:

    Default

    <?php
    if (!isset($page))
    {
    include("advert.html");
    }
    if(file_exists($_GET['page'].".php")){
    include $_GET['page'].'.php';
    }
    if(file_exists($_GET['page'].".html")){
    include $_GET['page'].'.html';
    }
    if(file_exists($_GET['page'].".txt")){
    include $_GET['page'].'.txt';
    }
    elseif (isset($page) && !@include("$page"))
    {
    echo "Error Page not found!";
    }
    ?>
    You mean that yeh?

  2. #12
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    PHP Code:
    <?php

    $page 
    $_GET["page"];

    if(
    $page == "") {
        
    $page "home";
    }

    $page "{$page}.php";

    if(!
    file_exists($page)) {
        
    $page "404.php";
    }

    include 
    $page;

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

    Latest Awards:

    Default

    Make sure your website has PHP5 installed.
    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).

Page 2 of 2 FirstFirst 12

Posting Permissions

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