SSI and PHP

SSI and PHP

Posted by: JCAB
Posted on: 2001-08-24 21:11:00

I'm wondering if there's a way to use PHP scripts in a normal HTML file, same as you can do with SSI.

I've even tried including a PHP file using SSI, and it doesn't work. It just puts, as text in the page: "[an error occurred while processing this directive]". The tag I used to do this was (without the space before the !, of course):

< !--#include virtual="HelloWorld.php"-->

I just want the possibility of using PHP in all my pages, without having to change their names.


Salutaciones,
JCAB

Re: SSI and PHP

Posted by: Monk
Posted on: 2001-08-25 19:09:00

As far as I know, and i've been working with php for a lone time, you can not include it using ssi. If you can then please, share the secret. But, you can, with only changing their extensions, use the php command to include other php files. but of couse the file using the include will have to have the compatible php extension. I believe dreamhost supports .php, .php3, .php4 and .phtml.

Hope it helps at least a bit.

Re: SSI and PHP

Posted by: ardco
Posted on: 2001-08-26 04:06:00

From searching it seems it might be possible to cause php parsing of html (or other) files, using .htaccess file(s). Haven't tried it, but am curious to know. Not sure how this combines with ssi.

http://phpbuilder.com/tips/item.php?id=79

http://www.phpbuilder.com/forum/read.php3?num=3&id=101255&loc=0&thread=101248

http://www.phpbuilder.com/forum/read.php3?num=1&id=104928&loc=0&thread=104928

Bob

ARDCO Templates by QuiltSmith, Ltd.
http://www.ardcotemplates.com/
Mens et Manus (personal)
http://www.mensetmanus.net/

Re: SSI and PHP

Posted by: Monk
Posted on: 2001-08-26 14:22:00

doing all of those following to the .htaccess file would allow you to include file extensions not supported by dreamhost to be parsed by php. you could, in theory if the dreamhost servers dont like the taste, include .html and .htm in the .htaccess file like so:
AddType application/x-httpd-php .html .htm
and the regular html files would be parsed as php files. i have tried this on my home computer running sambar and it didn't like it one bit, but then again thats windows and dreamhost is linux.

Re: SSI and PHP

Posted by: JCAB
Posted on: 2001-08-26 16:13:00

As I said in the post, I haven't been able to do it with SSI.

I'll try to use the .htaccess trick. I already did it for the SSI, so it might just work.

Thanx for taking the time to reply.


Salutaciones,
JCAB

Re: SSI and PHP

Posted by: JCAB
Posted on: 2001-08-26 16:15:00

Thanx, those were some interesting threads.

At least, I see I'm not the only one... :-)


Salutaciones,
JCAB

Re: SSI and PHP

Posted by: Monk
Posted on: 2001-08-26 19:46:00

you know its not working when it comes up and tries to save the file. that means it either a) doesn't like to allow you to specify alternative extensions [expecially ones that are preset by the server; in this case apache] or b) the .htaccess file was not programmed(typed) correctly.

Those are the same problems I had with my sambar server. I can't try in on dreamhost yet until I get back to my computer. But i'm leaning more towards the area that it might not like it very well, apache that is.

Tags: php scriptsphp filessihtml filetagspace