Forum Moderators: coopster
Here is my problem, I have a form that POST information to a CGI file, and when that CGI is excuted it displays a quote. -no problems there-
Now what I'm trying to do is have the form POST to a PHP page, so I can add an email function, than have that PHP page display/execute the CGI file. The problem I'm running into is that when I POST the form information to the PHP page, the POSTed info doesn't get passed to the CGI file.
I tried a couple of different ways to get the CGI file to work, but with little success, the methods I have tried are:
include('http://theSite/cgiFile'); - which displays the CGI file but doesn't pass the POST
include('cgiFile'); - displays what I assume is uninterrupted cgi code
echo join (file ('http://theSite/cgiFile'),""); - same results as first include
exec('http://theSite/cgiFile', $output);
echo(join("", $output)); - gives a blank page
the last method I tried came from a previous post I found in this forum "PHP file executes another PHP file, which executes a CGI script [webmasterworld.com]", which seems to be similar to my problem, but not quite the same.
So I guess my question is how do I run the CGI file thru the PHP page and have it execute properly, I know it can be done, I have seen 2 other sites that have done it, but I guess my PHP knowledge isn't as good as I thought it was. any help, links, or tutorials on how to do this would be greatly appreciated.
Thanks
Ken
[edited by: coopster at 6:19 pm (utc) on Jan. 23, 2006]
[edit reason] linked up reference [/edit]
Have a look in our PHP Forum Library [webmasterworld.com] and you will find a thread, Single form posted to multiple locations [webmasterworld.com].
Basically, you will see how you can open a raw socket and read/write to it. There are even more examples in the PHP manual pages under the related functions.