View Single Post
  #1 (permalink)  
Old 10-17-06, 06:26 AM
Oleks Oleks is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Question HTML Form 1 -> Perl -> return response to HTML form 2

Hi,
I am trying to return response from perl script to the HTML form. Those HTML form and perl file are located on a different servers. HTML form 1 is sending text to the form.pl file. File is processing that text. But, I do not know how to return response from perl file to the HTML form 2. Can somebody help me with this?

The script for HTML form is
Code:
<HTML>
   <HEAD>
     <TITLE>HTML form/TITLE>
   </HEAD>
   <BODY>
      <FORM NAME="form1" ACTION="http://www.domain.com/cgi-bin/form.pl" METHOD="POST">
          <INPUT TYPE="TEXT" NAME="Test" VALUE="" SIZE="18" MAXLENGTH="50"> <br>
          <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Go!">
      </FORM>

      <FORM NAME="form2" METHOD="POST">
          is: <INPUT TYPE="TEXT" NAME="Test" VALUE="" SIZE="16" MAXLENGTH="50">
      </FORM>
   </BODY>
</HTML>
The script for perl file form.pl is
Code:
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";

use LWP::Simple;

$a = <STDIN>;

# Do something simple
$b = substr ($a, 5, length($a)-18);

# print "Befor $a\n";
# print "After $b\n";

# How to return $b results to the HTML Form 2

Last edited by nico_swd; 10-17-06 at 06:38 AM. Reason: Please use [code] wrappers when posting code.
Reply With Quote