Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Can I execute PHP with SSI include? or vice versa

     

geogola

10:48 pm on Jan 9, 2003 (gmt 0)

10+ Year Member



i'd like to SSI include a .php file so it would actually run the code or if that's not possible in any way then can i php include a CGI file so it would execute.

thanks, gola

jatar_k

11:14 pm on Jan 9, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld geogola,

I don't think including a php file with SSI will work. If you have SSI enabled for a file extension then, I don't think, adding php parsed as well will work.

I would use the php extension on that particular page and then include the file using the php include or require function.

andreasfriedrich

11:20 pm on Jan 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let me welcome you to WebmasterWorld [webmasterworld.com] as well geogola.

Be sure to read Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post.

On Apache you may include the results of a CGI script with PHP´s virtual [php.net] function which performs a subrequest. This is similar to <!--#include virtual --> in SSI.

Andreas

andreasfriedrich

11:24 pm on Jan 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SSI includ[ing] a .php file so it would actually run the code is possible as well but not advisable. You could just use <!--#include virtual --> and have the PHP CGI binary execute and run the PHP code. But why would you want to do that when there is the PHP Apache module available which save the server from having to start a new process, etc.

Andreas

 

Featured Threads

Hot Threads This Week

Hot Threads This Month