Solved

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

Posted on 1997-12-19
2
416 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
2 Comments
 
LVL 1

Accepted Solution

by:
rets earned 100 total points
Comment Utility
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
Comment Utility
You might also call
  $ENV{QUERY_STRING} = "this=that&the=other";
  exec("my.cgi");
directly from your perl script.

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
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 viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now