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
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default Hmmmm... PHP +REP

    Hey, can anyone link me to an easily understood php include tutorial, how to target it =)

    drink up this bottle of yeah
    and P A I N T your body on me


  2. #2
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    What do you mean, how to target it?

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  3. #3
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php
    include "file.php";
    ?>
    OR

    PHP Code:
    <?php
    include ("file.php");
    ?>
    Or

    PHP Code:
    <?php
    include 'file.php';
    ?>
    Or

    PHP Code:
    <?
    include "file.php";
    ?>
    or

    PHP Code:
    <?
    include ("file.php");
    ?>
    PHP Code:
    <?
    include 'file.php';
    ?>
    or

    PHP Code:
    <?
    $page 
    file_get_contents($page);
    echo 
    $page;
    ?>

  4. #4
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Lol, one way would of been good enough
    Looking for a good desiner to design a social networking template.

    PM me.

  5. #5
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    I know I was just bored and wanted to show all the ways to include something

  6. #6
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default

    Denta, I know how to include a file but how to target the include like so when you click on 'News' the include changes from including the main to 'news'

    drink up this bottle of yeah
    and P A I N T your body on me


  7. #7
    Join Date
    Jan 2007
    Posts
    790
    Tokens
    3,429

    Latest Awards:

    Default

    google it ?

  8. #8
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    You could just use the $_GET function

    PHP Code:
    <?php

    $page 
    $_GET['page'];

    switch(
    $page){

    default:
    include(
    'main.html');
    break;

    case 
    "news":
    include(
    'news.html');
    break;
    }

    ?>
    If i understood you, thats what you mean.
    You'd go to

    index.php?page=news
    to load news.html

    or just index.php
    to load main.html

    If you mean change the included page without page load, you'd have to use AJAX.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  9. #9
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default

    yeah, that's it, thomas thanks! would I have to edit any of that code?

    drink up this bottle of yeah
    and P A I N T your body on me


  10. #10
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Well you'd obviously have to put it in the right part of your layout code and to add another page to it you would change it to:

    PHP Code:
    <?php

    $page 
    $_GET['page'];

    switch(
    $page){

    default:
    include(
    'main.html');
    break;

    case 
    "news":
    include(
    'news.html');
    break;

    case 
    "anotherpage":
    include(
    "anotherpage.html");
    break;
    }

    ?>

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

Posting Permissions

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