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 5 of 5
  1. #1
    Join Date
    Jan 2006
    Location
    Denton | UK
    Posts
    213
    Tokens
    0

    Default PHP Navigation Tutorial

    Hey,

    I've written a tutorial on a basic navigation in PHP which could be useful.

    Well first before we even begin trying, make sure your host is PHP supported, so don't try this with Freewebs.

    Also don't forget to save the index as .php

    First we open the PHP tag

    PHP Code:
    <?php

    ?>
    Then we add our switch variable which is pretty much self-explanitory.

    PHP Code:
         switch($id) { 
    Now if your new too PHP you can always tell a variable by the American Dollar sign $ Now we're ready too make the actually links.

    PHP Code:
         default: 
        include(
    'url.php'); 
    Now obviously you change the URL in the link too the URL you want it too display.

    Now for the ID of the page.

    PHP Code:
         break; case "The Page ID"
    I'm guessing that this has already been explaned, you just change the ID of the pages.

    Now too actually include the pages.

    PHP Code:
    include('page1.html'); 
    Now the code all together.

    PHP Code:
         <?php
        
    switch($id) { 
        default: 
        include(
    'url.php'); 
        break; case 
    "The Page ID":  
        include(
    'The ID.php');
    }
    ?>
    Now your links are going too have that cool look that all the big sites have

    page.php?id=ID

    Hope this helps, now for advanced PHP coders there are more and better ways too do this, but this is a very simple yet effective way.

    - Dan

  2. #2
    Join Date
    Dec 2005
    Location
    England | Brighton
    Posts
    1,378
    Tokens
    0

    Latest Awards:

    Default

    Parts of that help me out with php

    Thanks Dan +Rep

  3. #3
    Join Date
    Jan 2006
    Location
    Denton | UK
    Posts
    213
    Tokens
    0

    Default

    Hey,

    No problem. And if you have any other questions too do with PHP, or any other language I will try and help you out to the best of my ability.

    - Dan

  4. #4
    Join Date
    Dec 2005
    Posts
    993
    Tokens
    0

    Default

    cool nice mini tut +REP

  5. #5
    Join Date
    Jan 2006
    Location
    Denton | UK
    Posts
    213
    Tokens
    0

    Default

    Hey,

    Thanks dude. Just trying too help people, and also thanks for the rep.

    - Dan

Posting Permissions

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