www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP Includes

  1. #1
    Join Date
    May 2003
    Posts
    3

    PHP Includes

    I am having trouble with PHP Includes. For some reason they wont work. I've tried different tuts but none seem to work or i just don't get it. Can anyone help me?

    they're suppose to be easy.. no? lol

  2. #2
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    What exactly are you trying to do? To include a file, just rename the page to .php and put this code in it: <?php include("FileToInclude.whatever"); ?>. The file you want to include can have any extension.

  3. #3
    Join Date
    May 2003
    Posts
    3
    im trying to include a menu to my pages... so when I update it, I dont have to edit every page.

  4. #4
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    OK. here's how to do it:
    1) Put this code in the page you want to include the menu in:
    PHP Code:
    include_once("pagetoinclude.htm"
    (Changing the filename in the parantheses)

    2)Put the menu in the same directory as the file it's being included in.

    3)See if it works - note that it will have to be run on a PHP-enabled server to work.

    4)Post again if it doesn't!

  5. #5
    Join Date
    May 2003
    Posts
    3
    It worked. Thanks :]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles