Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
Making every page on a site into PHP

Posted by enquirer (enquirer), 6 September 2002
"Can I set up my web site so that every single web page (even the home page) contains bits of program code?"

Posted by John_Moylan (John_Moylan), 6 September 2002

As long you use extention thats recognised by the PHP preprocessor on your system. (.php, .php3 etc)

The fact is it will parse the PHP page and just spit out the HTML, there will be a marginal performance hit on the request though, but the preprocessors fast so it's not a major issue.



   Nothing in the page for PHP to see

Inform me if I'm wrong people, but I'm sure thats right

Posted by admin (Graham Ellis), 6 September 2002
Even the <?php and ?> aren't required, since PHP starts up in what I describe as "HTML mode" ...

And here's another "trick" for you.  If your web admin allows you to have  .htaccess files, then you can place such a file in any directory on your web site and add the line:
AddType application/x-httpd-php .html
then any file ending in .html will be taken as a PHP file too.  By the way, the .htaccess file is recursive, so if you put one in your document root ....

Posted by admin (Graham Ellis), 6 September 2002
P.S.   If you add something like

ErrorDocument 404 /net/report.php4?err=404

to your .htaccess file, you can replace your "error 404" page with a piece of PHP;  we use this to find out where broken links are coming in from via the $HTTP_REFERER variable ... that way we can easily track down the breakages to their source!

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: • WEB: • SKYPE: wellho