LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-26-2006, 06:39 PM   #1
<db>
LQ Newbie
 
Registered: Apr 2006
Location: US
Posts: 9

Rep: Reputation: 0
Question How to call another cgi program to return a variable


Anyone with ideas how to return variable from another program?

If program1.cgi contains line $var1 = 1 + 2;, how can I read the $var1 from program2.cgi? Programs are located on different servers.

Thanks,
<db>
 
Old 04-26-2006, 07:06 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Effectively, you can't.

The dialog is between the client and your CGI program. If you wanted to communicate with another CGI program, you'd effectively have to become another client (i.e. make an HTTP connection to the other CGI, write any GET or POST variables you wanted to send it, and read back the results).
 
Old 04-26-2006, 07:55 PM   #3
<db>
LQ Newbie
 
Registered: Apr 2006
Location: US
Posts: 9

Original Poster
Rep: Reputation: 0
Actual problem is this:
program1.cgi must print $number amount of images to webpage, but the pictures are on another server. I was thinking if I could write little script (program2.cgi) to my image server, which would return the image quantity when called from program1.cgi
Any better ways to approach this?

<db>
 
Old 04-27-2006, 03:36 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
just use a remote procedure call, or create a server on the other machine
over a socket.
2 cgis isn't the way to go I'd say.
 
  


Reply



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
does a system call return value?? docetes Programming 2 03-16-2006 05:40 PM
How to Call a C program from Perl CGI Script anoop_cn Programming 1 05-11-2004 04:37 PM
How can get values return from a system call quenn Programming 1 09-16-2003 11:05 PM
Problem with accept() call which doesn't return jph Linux - General 0 07-28-2003 04:34 AM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration