I have a website that uses the same navigation links on all of the 40+ pages. If i ever have to change one of the links i have to amend each 40+ pages individually. Im sure php can call a file so that you only have to change 1 file to update all 40+ how do i do that? What do i need to do with the HTML files and what do i need to do in the PHP file i call from. If you use a PHP include in an html file does it automatically become a PHP file??? Please help Dolalu
Create one php page that has all of your links then include/require that page in all the others example: Links.php <?php echo " <a href='http://mysite.com/link1.php'>Link 1</a> <a href='http://mysite.com/link2.php'>Link 2</a> <a href='http://mysite.com/link3.php'>Link 3</a> "; ?> PHP: index.php <?php include ('links.php'); welcome to my site! ?> PHP: gallery.php <?php include ('links.php'); Here are my pictures! ?> PHP: funstuff/arcade.php <?php include ('../links.php'); Try out my arcade! ?> PHP:
no, but you could mod rewrite .html to be processed by php and if you wanted to be really tricky, make apache always include your links.php file before all other files.
Synch how would you get it to include the php files before and after every file? Thatd be great for me as currently i manually include my header and footer around every page. Does it cause extra load on the server, or will apache "remember" so will generally not impact performance. Thanks
I know this is an old post but I've been looking for this info for a week now. php makes my brain stop. Thanks