Forum Moderators: phranque

Message Too Old, No Replies

SSI commands to work in PHP extension

SSI PHP .htaccess apache server

         

skinter

10:54 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



I have a PHP home page, and I want to use some SSI commands in it. I was wondering is there a way to get SSI commands to work on a PHP extension? I've searched Google, but the code that I saw only made PHP use SSI commands only, so all the PHP on my page didn't work.

jatar_k

10:56 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



this has been asked many times and there really isn't any reliable way to do it.

Why do you need to do it? Maybe a better understanding of the situation could help us find a different solution.

skinter

11:01 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



I have a random quote generator, and a PHP counter. I suppose I don't really need either, but just a luxury I'd like them. No worries if I can't get it to work, and thanks for the help so far.

jatar_k

11:02 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if they are both php then you could just use the include [php.net] function since the page is php as well

skinter

11:05 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



One of the commands is as follows, <!--#exec cmd="cgi-bin/randhtml.cgi"-->

All the PHP commands that I have running (counter, IP logs, etc.) all work fine.

EDIT: I thought that the first command was SSI. Is it?

jatar_k

11:11 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the command itself is SSI, the script might be perl

you could also look at exec [php.net] or passthru [php.net] though we have had mixed results with these they will work

skinter

11:16 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



Thank you so much.

Span

12:09 am on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Forgot where I've found this, but it works for me:

<?php
putenv ("REQUEST_METHOD=GET");
passthru ("cgi-bin/script.cgi");
?>

skinter

3:43 am on Jun 14, 2005 (gmt 0)

10+ Year Member



Awesome, thanks guys!