nasa has asked for the wisdom of the Perl Monks concerning the following question:
print <<END_ERR_HTML; <HTML> <form method=POST action=viewdata.cgi> <font size="4" color="#FF0000">Enter data here.</font> <input type=text name="handle" size=30> <input type=submit VALUE="View Data"> </form> </html> END_ERR_HTML
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; $value =~ s/<([^>]|\n)*>//g; $value =~ s/\r//g; $value =~ s/\n/<br>/sgm; $POST{$name} = $value; } @scald = ($POST{'handle'}); $data = $scald[0]; print "$data";
#!/usr/bin/perl $now = name; $wanted = somedata; print "Location: open.cgi?id=$now\n\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing data from script to script.
by dorward (Curate) on Dec 13, 2006 at 15:42 UTC | |
by jettero (Monsignor) on Dec 13, 2006 at 15:54 UTC | |
|
Re: Passing data from script to script.
by liverpole (Monsignor) on Dec 13, 2006 at 15:58 UTC | |
by SheridanCat (Pilgrim) on Dec 13, 2006 at 23:57 UTC | |
|
Re: Passing data from script to script.
by SFLEX (Chaplain) on Dec 13, 2006 at 17:05 UTC |