LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   call perl cgi script from php (https://www.linuxquestions.org/questions/programming-9/call-perl-cgi-script-from-php-276204/)

j-ray 01-10-2005 02:52 PM

call perl cgi script from php
 
i need to call a cgi script that resides on a different server from within a php script but dont know how. i couldn find a suitable function in the php man nor any howto on the web. i guess it should be easy so if u know plz tell me
thanks a lot
j

Cedrik 01-11-2005 08:09 AM

Try (need PHP >= 4.3.0, if not try fopen() family functions) :

PHP Code:

$cgi "http://whatever.com/cgi-bin/mycgi.pl?Avar=Avalue";
echo 
file_get_contents($cgi); 


j-ray 01-14-2005 08:23 AM

thanks for your reply,

i got another recommendation to use lynx to post to the cgi.
but i've changed plans anyway and switched to perl and call the other cgi thru LWP.
this works and supports ssl.


All times are GMT -5. The time now is 01:38 AM.