Solved

Trying to POST data to a second cgi from a perl script.

Posted on 1997-12-19
2
431 Views
Last Modified: 2013-12-25
We have an HTML form which collects data (Name, address etc..)  this calls a standard perl script which creates other data automatically, this inturn has to send 4 of these fields to another cgi script (Written in C). The cgi script written in C can be called directly from HTML.

We have made a temporary workaround by creating a HTML page in between which inturn calls the the second cgi script. This works fine....

We would like to eliminate the HTML page in between scripts.

Any ideas ?
0
Comment
Question by:tessel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
rets earned 100 total points
ID: 1831711
When you print your HTTP Headers you usually say something like:

print "Content-type: text/html\n\n";

This should be the very first thing you print.  Instead you could print:

print "Location: http://www.myserver.com/cgi-bin/my.cgi?this=that&the=other">

This tells the browser to go to www.myserver.com/cgi-bin/my.cgi and pass those URL encoded items to my.cgi.  This should be the only thing printed in your CGI as the browser will be redirected to the specified location.

For more information on URL encoding you can see O'Reilly's Webmaster in a Nutshell pp.76-78.

-K

0
 
LVL 84

Expert Comment

by:ozo
ID: 1831712
You might also call
  $ENV{QUERY_STRING} = "this=that&the=other";
  exec("my.cgi");
directly from your perl script.

0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question