LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-10-2005, 02:52 PM   #1
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,419

Rep: Reputation: 99
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
 
Old 01-11-2005, 08:09 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
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); 

Last edited by Cedrik; 01-11-2005 at 08:10 AM.
 
Old 01-14-2005, 08:23 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,419

Original Poster
Rep: Reputation: 99
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CMS Perl/CGI/PHP script ANU Programming 2 10-25-2006 10:11 AM
CGI/Perl script problems. Randvegeta Linux - Software 8 12-30-2004 12:24 AM
/perl/php/cgi/mysql dramous Linux - Newbie 0 10-08-2004 05:11 PM
How to Call a C program from Perl CGI Script anoop_cn Programming 1 05-11-2004 04:37 PM
PHP verses CGI Perl te_conway Linux - Security 2 03-28-2002 07:51 AM


All times are GMT -5. The time now is 05:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration