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 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Nov 2006
    Location
    Doncaster, UK
    Posts
    1,700
    Tokens
    0

    Latest Awards:

    Default Ok then, PHP Help please xD

    In my main content div I have this:

    PHP Code:
    <?php include("home.php"); ?>
    So, in my nav div, what would code would I have to put if I wanted to open say news.php into the main content div?

    +Rep to any helpers.
    unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
    puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
    costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
    norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.



  2. #2
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    Are you using iframes, otherwise you just replace home.php with news.php and save it.

  3. #3
    Join Date
    Nov 2006
    Location
    Doncaster, UK
    Posts
    1,700
    Tokens
    0

    Latest Awards:

    Default

    I know how to work iframes, but iframes are crap and should be blown up.

    I'm trying to figure out how the hell to use includes.
    unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
    puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
    costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
    norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.



  4. #4
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Here is sommert i wrote: Hope it is what u need!
    <?php
    // Assign the requested page to a shorter variable for simplicity.
    // The value of $_GET["page"] will be obtained from index.php?page=RIGHT_HERE
    $p = $_GET["page"];
    // Check for bad requests. This is necessary to prevent the wrong files
    // from being included. This is a security measure.
    if (strpos($p,"..")) {
    // A bad request has been made, exit immediately. Do not proceed
    // with the inclusion.
    // strpos($p,"..") checks for presence of ".." in the page request.
    // ".." can be used to access files in parent directories
    die("Bad page request");
    }
    // File to include.
    // this will be something like '/www/page.php'. If $p is empty, fall back
    // main.php. THIS FILE MUST EXIST, otherwise bad things will happen.
    if (!$p) $p = "main";
    $content_file=$_SERVER["DOCUMENT_ROOT"]."/".$p.".php";
    // See if $content_file exists. If it does not, redirect to the homepage.
    if (!file_exists($content_file)) {
    header("Location: {$_SERVER["PHP_SELF"]}");
    exit();
    }
    // At this point everything is fine. Set the appropriate title and then
    // include the files.
    // Syntax: $variable = (condition) ? value_if_true : value_if_false;
    $title = ($p) ? "$p - My Site!" : "Main page - My Site!";
    include("header.php");
    include($content_file);
    include("footer.php");
    ?>
    Last edited by Florx; 26-11-2006 at 04:30 PM.

  5. #5
    Join Date
    Nov 2006
    Location
    Doncaster, UK
    Posts
    1,700
    Tokens
    0

    Latest Awards:

    Default

    No tutorial on how to use it?

    Where did you steal that from?
    unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
    puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
    costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
    norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.



  6. #6
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    http://f0rked.com/articles/dynamism

    Lol i didnt write it. Well i did but i didnt w.e. here ^

  7. #7
    Join Date
    May 2006
    Location
    Wakefield, West Yorkshire
    Posts
    1,118
    Tokens
    0

    Latest Awards:

    Default

    Use the easier way, where you get page.php?id=whatever.
    I'll try and find you a tut.

  8. #8
    Join Date
    Nov 2006
    Location
    Doncaster, UK
    Posts
    1,700
    Tokens
    0

    Latest Awards:

    Default

    Thanks dan.
    unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
    puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
    costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
    norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.



  9. #9
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:


  10. #10
    Join Date
    May 2006
    Location
    Wakefield, West Yorkshire
    Posts
    1,118
    Tokens
    0

    Latest Awards:

    Default

    Code:
     <?php
    switch( $_GET[’id’] )
    {
    default:
    include ‘main.htm’;
    break;
    
    case ‘community′ :
    include ‘community.htm’;
    break;
    }
    ?>
    The code is very simple...

    You can copy the 3 lines as many times as you wish (the case, include and break) for more pages.

    The top one which says deafault it the page you wish to load when the site is loaded.

    You can change the bit at the top that says id to whatever you want, it will appear in the url, e.g. index.php?id=community.

    Put the code in your content area.

    Off topic: 3 pure for your layout?

Page 1 of 2 12 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
  •