GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Question (https://gfy.com/showthread.php?t=518849)

aico 09-20-2005 10:01 PM

PHP Question
 
I changed a .shtml page into a .php page so I could include some PHP files, etc.

On the .shtml page I was calling out a cgi script to be run like this:
<!--#exec cgi="../cgi-bin/script.cgi" -->

But now that the page is a .php it's not running. How to I call this out with php?

I tried:
<?php
include("../cgi-bin/script.cgi");
?>

But that didn't work...

Thanks! :helpme

broke 09-20-2005 11:26 PM

exec( "/path/to/cgi/script/script.cgi" );

grumpy 09-21-2005 12:22 AM

include "file.php";

darksoul 09-21-2005 01:00 AM

Quote:

Originally Posted by grumpy
include "file.php";

how does it feel to post such a useless reply ?
have you even bothered to read the thread ?

submitter 09-21-2005 02:38 AM

try
virtual("../cgi-bin/script.cgi");
it work for me

RazorSharpe 09-21-2005 02:58 AM

<?virtual("../cgi-bin/script.cgi");?>

that should work for you ...

Radiate 09-21-2005 06:33 AM

you can use the SetHandler directive in htaccess to process the .php file as a .shtml file if you need to

drama 09-21-2005 06:35 AM

ask jimthefiend, he knows everything!

Gungadin 09-21-2005 06:36 AM

Yeah, virtual might work, havent messed with it in a while. You could also try to fopen("http://www.your.com/cgi-bin/file.cgi"), slower but maybe better.

The problem is that PHP has no idea how to parse your CGI code, so you will have to read in the OUTPUT of the script.

-G

Nathan 09-21-2005 06:44 AM

virtual() is your best solution here as long as it is apache.

You can also use passthru() to execute the script, this would not case an apache subrequest to launch, and might be better in some cases.

ServerGenius 09-21-2005 06:46 AM

Quote:

Originally Posted by drama
ask jimthefiend, he knows everything!

:1orglaugh :1orglaugh :1orglaugh

aico 09-21-2005 01:20 PM

Hey, thanks for all the replies. I just made a seperate .shtml page and put it in an iframe, that worked the best.

Thanks!


All times are GMT -7. The time now is 10:33 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123