Webmaster Hints, Tips and Advice

How to add PHP to your Webpage

Those webmasters who have the majority of their website built using server side includes (SSI’s) for headers, footers and navigation etc may have difficulties in inserting a php script into the main body of the page.  You may think you can simply change the page extension to a .php but you will find that the script works but all your common files referred to by the SSI’s are missing and the page layout is destroyed. 

To overcome this problem, create your php script in its own file and upload to your web server.  At the point you need to insert the php script just call it up with your normal SSI code i.e.

<!--#include virtual="directory/script.php"-->

Note – this will only work on .shtml pages.

This article can be found at: www.getontheinternet.net/webmaster-tips/php/index.shtml

[Updated - 29 March 2007]

Copyright © 2007 David Kaye – All rights reserved.
For more free webmaster tips and articles like this on website design, hosting and promotion visit http://www.GetOnTheInternet.net

Link to this article

If you would link to link to this article please copy and paste the following code into your webpage:

<a href="http://www.getontheinternet.net/webmaster-tips/php" target="_blank">How to simply add PHP to your Webpage</a>

Click here to read more free website design and hosting hints, tips and advice