Forum Moderators: coopster

Message Too Old, No Replies

Cant see PHP on my SHTML pages

php/shtml

         

meakip

10:33 pm on Nov 30, 2006 (gmt 0)

10+ Year Member



Hi, i have been trying to display php eliment on my html pages I have tried puting "<?php include("mainfile.php");?>" but nothing appears, has anyone got any ideas.

patrick

Psychopsia

11:04 pm on Nov 30, 2006 (gmt 0)

10+ Year Member



Hi!

Search for "php shtml" [google.com]

coopster

11:06 pm on Nov 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, meakip.

If you want your .shtml pages to be parsed as PHP you would need to add them to the PHP handler to be parsed by the PHP engine. However, since you are using PHP, why even use SSI anymore? You can do anything you want and more with PHP that you can do with SSI.

whoisgregg

11:08 pm on Nov 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to tell Apache that .shtml files should be parsed by PHP... Something like the following in your root .htaccess file should do the trick:

[code] AddType applicatiyou code]

I hope someone will confirm that this method works for .shtml files. :)

Welcome to WebmasterWorld [webmasterworld.com], meakip!

eelixduppy

11:11 pm on Nov 30, 2006 (gmt 0)



>>>I hope someone will confirm that this method works for .shtml files.

Should work for shtml files, however I will second coopster: Go PHP :)

oh, and welcome!

coopster

11:13 pm on Nov 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Related discussion with confirmation (follow links in this thread):
[webmasterworld.com...]

whoisgregg

3:44 pm on Dec 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow, I guess I didn't notice the formatting of my post got hosed... Here's the directive again:

 AddType application/x-httpd-php .shtml .html .htm .php