Click to See Complete Forum and Search --> : 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
Nevermore
05-25-2003, 04:03 AM
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.
im trying to include a menu to my pages... so when I update it, I dont have to edit every page.
Nevermore
05-26-2003, 03:28 AM
OK. here's how to do it:
1) Put this code in the page you want to include the menu in:
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!