• home
  • forum
  • my
  • kt
  • download
  • PHP nav

    Author: 2007-08-24 16:08:35 From:

    Hey there people..

    Another fun tut here from Base

    I am going to show you that cool navigation thing you know: page.php?p=downloads

    and things like that..

    Firstly i would like to point out that there are over 30 different ways of achiving this.

    Because i like my tutorials to be easy to understand, i am going to show you the IF Statement way of doing this, as in general PHP it's easier.

    CODE
    <?php

    if($_REQUEST['page'] == "home"){

    echo "You are viewing the home page";

    } elseif($_REQUEST['page'] == "downloads") {

    echo "You are viewing the downloads page";

    } else {

    echo "Your not viewing any specific page";
    }
    ?>


    So let's say you had a page called index.php

    You could go: index.php?page=home
    and it would show:

    You are viewing the home page

    or if you did index.php?page=downloads

    then it would show: You are viewing the downloads page

    Otherwise it would show: Your not viewing any specific page

    Remember we don't put $_POST[''] UNLESS we have just posted a form linking to that page.

    Otherwise it won't work...

    Hope you have learned somthing!

    Base

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (6)
      Cookies and Sessions (8)
      Counters (8)
      Database Related (8)
      Date and Time (9)
      Development (6)
      Discussion Boards (7)
      E Commerce (6)
      Email Systems (9)
      Error Handling (5)
      File Manipulation (10)
      Flash and PHP (4)
      Form Processing (7)
      Guestbooks (8)
      Image Manipulation (3)
      Installing PHP (5)
      Introduction to PHP (9)
      Link Indexing (6)
      Mailing List Management (8)
      Miscellaneous (10)
      Networking (6)
      News Publishing (6)
      OOP (8)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (5)
      Postcards (0)
      Randomizing (8)
      Redirection (8)
      Searching (6)
      Security (6)
      Site Navigation (7)
      User Authentication (10)
      WAP and WML (7)
      Web Fetching (0)
      Web Traffic Analysis (11)
      XML and PHP (0)

    New

    Hot