[Webinar] Streamline your web hosting managementRegister Today


1 click submit 2 cgi <form>

Posted on 1999-10-25
Medium Priority
Last Modified: 2013-12-25
I would like to submission form method post

1 button for 2 form

<form  method="POST" action="../cgi-bin/add.cgi">
<form  method="POST" action="http://www.some.com/cgi-bin/backup.cgi">

how should i do ?
Question by:tong111797
  • 2
  • 2
LVL 25

Expert Comment

ID: 2157719
Rewrite your CGIs so that a single CGI handles both tasks or have the first CGI post to the the second.

Author Comment

ID: 2157732
how to 1st cgi post to the second on remote host ?

i am very newbie..

thank for advance
LVL 25

Accepted Solution

clockwatcher earned 1200 total points
ID: 2158035
Here's an example.

It first calls testmove.pl which then hands it off-- along with the variables that were passed to it-- to the experts-exchange cgi search script.

Here's the html page which references the first cgi
Search EE:<BR>
<form action="testmove.pl" method="post">
<input type=hidden name=ta value="57">
<input type=text size=30 name=search value=""><BR>
<input type=radio name=everything value="" checked>&nbsp;&nbsp;Search CGI Topic Area<br>
<input type=radio name=everything value=1>&nbsp;&nbsp;Search Everything<BR>
<input type="submit">

  use HTTP::Request::Common qw(POST);
  use LWP::UserAgent;
  use CGI;

  $myCGI = new CGI;
  $ua = new LWP::UserAgent;

# Create a hash of all the parameters
  foreach ($myCGI->param) { $myparams{$_} = $myCGI->param($_); }

  my $req = POST 'http://www.experts-exchange.com/bin/SimpleSearch', [ %myparams ];
  my $page = $ua->request($req)->as_string;

  $page =~ s#</head>#<base href="http://www.experts-exchange.com/"></head>#i;

  print $page;


If my server is up, you can check it out at:


Author Comment

ID: 2158077
thankz. Look complex for me but it is a good code.

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
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 how to look for a specific file type in a local or remote server directory using PHP.
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 …
Suggested Courses

607 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