?
Solved

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

Posted on 1997-12-19
2
Medium Priority
?
440 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 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…
Suggested Courses

777 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