Basic PHP help please

Discussion in 'PHP' started by 8everything, Aug 22, 2006.

  1. #1
    How do you create a page that includes you header and navigation page in a PHP file. SO, when you update your navigation page, you only edit it in 1 page and not all of your webpages (but the changes will be shown in all of your webpages).

    I've seen something like this... I think it goes "header footer here" etc?:confused:

    Thank you:)
     
    8everything, Aug 22, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just put your menu in a file and include it to the page:
    <?php
    include("menu.php");
    ?>
     
    mad4, Aug 22, 2006 IP
    8everything likes this.
  3. samshah

    samshah Banned

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yea include the menu
     
    samshah, Aug 22, 2006 IP
    8everything likes this.
  4. retSaMbew

    retSaMbew Banned

    Messages:
    739
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #4
    include() or require()
    require() works better for inclusion of global variables for the entire php file
     
    retSaMbew, Aug 22, 2006 IP
    8everything likes this.
  5. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yay, rep for everyone. Thank you:) I'm going to test this out now!
     
    8everything, Aug 22, 2006 IP