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
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
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
Yep!

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.

example:

<?php
<html>
 <head>
   <title>Doh!</title>
 </head>

 <body>
   Nothing in the page for PHP to see
 </body>
</html>
?>

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 www.opentalk.org.uk 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., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho