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 3 FirstFirst 123 LastLast
Results 11 to 20 of 26
  1. #11
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Foskett View Post
    It works the same way as the code you're using.. Besides the fact that it's much cleaner, and easier to use.
    well are the red parts what are supposed to be edited with the appropriate file names?

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

    Latest Awards:

    Default

    No.. you don't edit anything..

  3. #13
    Join Date
    Apr 2009
    Location
    Illinois, USA
    Posts
    130
    Tokens
    359

    Default

    Quote Originally Posted by Robald View Post
    well are the red parts what are supposed to be edited with the appropriate file names?
    In the code Dentafrice posted, you don't edit a thing, you simply put it into your layout where you want your content, and use the url:
    http://www.yourwebsite.com/index.php?page=(page)

    It's better than having to edit the php script that you have everytime you have a new page.


    My last reputation was from ThisNameWillDo!.

  4. #14
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Oh OK, thanks. It just confused me not having to tell it what the files were etc .

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

    Latest Awards:

    Default

    You get that from the variable.

  6. #16
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    The only thing now is, when I go to http://localhost/site/ it shows the 404 error in the content area instead of my homepage content. It only shows the homepage once I click 'Home' on the nav.

    Is there a default setting I can add to that code or something?


    Code:
    <?php
    
    $page = $_GET["p"];
    $page = "{$page}.php";
    
    if(!file_exists($page)) {
        include "404.php";
    } else {
        include $page;
    }
    
    ?>

  7. #17
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    PHP Code:
    <?php

    $page 
    $_GET["p"];
    $page = ($page == '') ? 'home' $page;
    $page "{$page}.php";

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

    ?>

  8. #18
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    thank you sir .

  9. #19
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Edit the part that says home for the page you want.

  10. #20
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    home is exactly what I want I'll owe you about 3 reps lol

Page 2 of 3 FirstFirst 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
  •