And the write.cgi file is like so.<form method="post" action="http://test/cgi-bin/write.cgi"> First Number: <input type="text" size="10" maxlength="4" name="no1"> Second Number: <input type="text" size="10" maxlength="1" name="no2"> Third Number: <input type="text" size="10" maxlength="1" name="no3"> Forth Number: <input type="text" size="10" maxlength="8" name="no4"> <INPUT type="SUBMIT" value="Submit">
My question is how can I output each number passed to the write.cgi rather than having the array $FORM print it?#!/usr/bin/perl print "Content-type:text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } print "<html><head><title>Form Output</title></head><body>"; print "<h2>Results from FORM post</h2>\n"; foreach $key (keys(%FORM)) { print " $FORM{$key}<br>"; print"$key<br>"; } print "</body></html>";
In reply to cgi input box process script by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |