FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP loading in .htm and .html sites





Ghost900
I found a .htaccess script that shows PHP code on a .htm site.

Here is the code:
Code:
AddType application/x-httpd-php .htm .html


I tried it and it worked fine but I wonder if this is compatible with multiple browsers. I don't know if some browsers don't load .htaccess or not.

Thanks for reading. Very Happy
SonLight
The change affects the server only. Your browser never sees unprocessed php code, unless there is an error in the server setup.

The main argument against using the script is that ALL html pages must be scanned for php code. If almost all of your pages use php code anyway, you can hide the fact that you are using php with this script.
RiCtee
The .htaccess file is just a way of setting configurations for Apache, on a per-directory basis. So the browser client would not affect it.
Ghost900
OK so it may take a little longer for the page to load with the script. Confused

Thanks for your feedback.

I wasn't sure weather it affected the server or was a browser thing.
imagefree
Ghost900 wrote:
I found a .htaccess script that shows PHP code on a .htm site.

Here is the code:
Code:
AddType application/x-httpd-php .htm .html


I tried it and it worked fine but I wonder if this is compatible with multiple browsers. I don't know if some browsers don't load .htaccess or not.

Thanks for reading. Very Happy


it doesnt depend on browsers. Browser only see a static HTML page but infact the page is not static (because of the .htaccess code).
riccopt
that code is to PARSE HTML pages using the PHP parser from the server...
you can add ASP, JSP, XML... and anything you want... then all the files with those extensions will be parsed by the PHP parser...
it makes things easier to "lie" to people telling them that your site uses one language when it uses another... (that is only good for FUN)
Related topics
Dynamic User Customizable Sites. CSS + PHP = Awesome!
Selling Web Sites for frih$!!
Your top5 scripts pages
PHP Test File
HTML sites made cheap here!!!
Getting rid of extension (.htm, .html, .shtml, etc.)
webpage design programs
Need my site cut 100 FRIH$
Can You Get HTML in Your PHP Mail Script?
PHP in HTM or vice versa for search ranking
Is index.html different from public_html.html
PHP Code to HTML
Tutorial: How to write HTML without ANY code whatsoever!
[help=html,php]Error en forma de contacto...
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.