Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form trouble

Status
Not open for further replies.

FN

Programmer
Aug 7, 2002
4
AU
Hi
I dont know if this could be done in perl but I will ask anyway.


<FORM ACTION=&quot; METHOD=&quot;POST&quot;>Test:<INPUT NAME=&quot;name&quot; SIZE=29>
<INPUT type=&quot;hidden&quot; name=&quot;code&quot; value=&quot;hello_there&quot;>
<INPUT TYPE=SUBMIT VALUE=&quot;SEND MESSAGE&quot;>

What I want to do is to execute this form in my perl script just by starting the script, so I dont want to exec it by pressing the send button.

A very big thanks in Advance.

/FN
 
Hi FN,
I *think* that you want your script to print the form to your browser and at the same time het the results...

Then take a look at this code:
Code:
use CGI qw/:standard/;
print &quot;Content-type: text/html\n\n&quot;;
print <<FORM;
<FORM METHOD=&quot;POST&quot;>Test:<INPUT NAME=&quot;name&quot; SIZE=29>
<INPUT type=&quot;hidden&quot; name=&quot;code&quot; value=&quot;hello_there&quot;>
<INPUT TYPE=SUBMIT VALUE=&quot;SEND MESSAGE&quot;>
FORM

$name = param('name');
$code = param('code'); #$code will be &quot;hello_there&quot; (without quotes)
## and the rest of the code...

To explain:
not setting a &quot;action&quot; in your form will let it submit to itself... and since the form is in your script, it will submit to the script... the CGI is to get the input... just use $variable = param('name_of_input');

Would this help??
I hope so...

math


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top