Sending to external CGI
Moderator: General Moderators
Sending to external CGI
Here is a little more complex question than my previous ones:
I need my PHP code to send a form to cgi script located in entirely different web server. But here is the thing, the php page is not viewed on any regular browser. It is invoked by an embedded device.
The PHP script needs to retrieve data from a database and send that date to the cgi script and then read the result sent from the cgi script, which is then echo'd onto the php file sent back to the embedded device.
I know how to retrieve data from MySQL and process it. But what I'm stumped about is how do I send the data to that cgi script and read the result. Can anyone give me any pointers?
Cheers,
Mounir
I need my PHP code to send a form to cgi script located in entirely different web server. But here is the thing, the php page is not viewed on any regular browser. It is invoked by an embedded device.
The PHP script needs to retrieve data from a database and send that date to the cgi script and then read the result sent from the cgi script, which is then echo'd onto the php file sent back to the embedded device.
I know how to retrieve data from MySQL and process it. But what I'm stumped about is how do I send the data to that cgi script and read the result. Can anyone give me any pointers?
Cheers,
Mounir
If you are using a precompiled PHP version on windoze you will need the zip package (as this contains the extra extensions).
The php_curl.dll also depends on ssleay32.dll and libeay32.dll which are also distributed in the zip package although the later two dlls must reside in your system's path.
If you are on any other platform and using precompiled binaries you will probably just have to enable the extension, but failing that you will have to compile cURL first then compile PHP with cURL support at configure time.
The php_curl.dll also depends on ssleay32.dll and libeay32.dll which are also distributed in the zip package although the later two dlls must reside in your system's path.
If you are on any other platform and using precompiled binaries you will probably just have to enable the extension, but failing that you will have to compile cURL first then compile PHP with cURL support at configure time.
Code: Select all
curl_exec();