Jump to content


Photo

[Need help, please] PHP for beginner


  • Please log in to reply
1 reply to this topic

#1 kelly8

kelly8
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 September 2006 - 12:49 AM

[Mods, if this is not the right forum, plese move it and sorry in advance]

Hello,
I was wondering if any of you could give me some guides on how to use one "main" template to update all pages on my site (instead of updating each page). Can I set up, more than one "main" templates?

For example, if I need to make some changes on left/right/top/bottom side, I only need to make the change on the "main" template and all of the pages will automatically changed.

I heard it could be done using php and modifying .htaccess. Tried to read some guides on the internet and did not really get what I am looking at and I don't really understand it. Could you please give me some guides?

Thank you in advance. I'd really appreciate it
Kelly

#2 Guest_WarpNacelle_*

Guest_WarpNacelle_*
  • Guests

Posted 25 September 2006 - 08:04 PM

I'm not sure about any technique modifying .htaccess but an easy method with php is to use the include() function.

For example, what I do,  is have the code for my header, footer and menu in a seperate file.

Then, each content page has the following:

include ('header.php');

include ('footer.php');

You just put the include() line where you want the code to go and PHP inserts that code right there.  So if you wanted to change your site-wide header, you just edit the "header.php" file.

(On a side note, they don't have to be .php extensions.  It can be .html or even .inc - for include)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users