homepage Welcome to WebmasterWorld Guest from 54.227.25.58
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Can I run PHP on static pages?
sun818




msg:1271260
 9:06 pm on Nov 29, 2002 (gmt 0)

Is there a way with Apache and .htaccess to run PHP on top of static HTML pages? 99% of my site is currently static, but would like to add some additional text based on referrer domain. Like if the link is from a forum posting, I could write "Thanks for visiting from the widget forum". If this is possible, is there a processing load on the server that the web host might not like?

 

seindal




msg:1271261
 9:36 pm on Nov 29, 2002 (gmt 0)

This in your Apache config should enable PHP on all .html files.

AddType application/x-httpd-php .html

It will have some impact on server performance, since every .html files will have to be parsed. Maybe you can add it just for individual files by using <Files ...> sections.

You will also loose some HTTP headers that the default handler in Apache sets based on the file sent. This is stuff like Last-Modified etc.

So, it should be doable, but it will have a pricetag.

René.

sun818




msg:1271262
 6:52 pm on Dec 2, 2002 (gmt 0)

What about a client side JavaScript include on each page to do the same?

seindal




msg:1271263
 7:01 pm on Dec 2, 2002 (gmt 0)

PHP runs on the server-side. There can be no interaction with javascript. PHP can generate javascript code, but that is another thing.

René

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved