Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
How php can be used in html documents (Read 3143 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
How php can be used in html documents
29.08.07 at 07:42:15
 
How php can be used in html documents
 
To standardise the webpage I was looking for a way to include pieces of HTML or output of PHP into HTML pages. I would like to include the HTML for e.g. the website header or a list of last posted forum messages. Here is how I achieved this.
 
Let all html and htm files be processed as php files
Create a file called .htacces in the html directory on the webserver (LINUX). You can type vi .htaccess to edit or create the file. Add the following line to this file:
AddType application/x-httpd-php .html .htm
 
Include files
Now all the html is processed as PHP files can be included using the PHP syntax. Example:

<html><body><?php include "myheading.php" ?>
</body></html>
Back to top
 
« Last Edit: 29.08.07 at 07:44:16 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1