PHP help????????????????????????

  • Thread starter Thread starter floridahotty
  • Start date Start date
F

floridahotty

Guest
Ok so I have a godaddy account and I am using PHP.But I have to put the header.php and the footer.php in every folder.I would like it only to be in the main folder.How do I do this?
 
edit the code
example: index.php
folder
+main.php
in main folder file have index.php and folder in folder have main.php
if you wan take main.php to main folder you most edit code from index.php looking for folder\main.php. delete folder\
 
Just reference the header.php or footer.php file with a full path.

I always create a folder called Include so would put header.php and footer.php in the include folder and then reference them like this.

From the root (main) level:

include("Include/header.php")

from one folder down from the root:

include("../Include/header.php")

Two levels down?

include("../../Include.header.php")

tha'ts all there is to it.
 
Back
Top