[Gllug] Quick Perl question
Robert Wood
rob at empathymp3.co.uk
Fri Jul 27 10:53:20 UTC 2001
If you mean the form/value pairs; then use this, or alternatively use the
cgi-lib.pl to do it, but i always prefer to not use modules
sub Get_Form_Data {
#Get Input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@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;
$FORM{$name} = $value;
}
}
then your data is available in the form of if a form item is called data
(i.e. <INPUT TYPE=text NAME=data> then that field is then $FORM{'data'}
Robert Wood [Data Centre Support Technician]
e: robert.wood at interhouse.redbus.com
t: +44 (020) 7531 8700
f: +44 (020) 7531 8701
a: Redbus Interhouse (UK) Limited
6 / 7 Harbour Exchange Square
London, E14 9GE
w: http://www.interhouse.redbus.com/
> -----Original Message-----
> From: gllug-admin at linux.co.uk [mailto:gllug-admin at linux.co.uk]On Behalf
> Of Anthony.Leung at ubsw.com
> Sent: 27 July 2001 11:13
> To: gllug at linux.co.uk
> Subject: [Gllug] Quick Perl question
>
>
> Just a quick question: could someone please tell me how to request
> the strings from a form submitted as a post action="test.pl"
> Ta v. much.
> Anthony
>
>
>
> Visit our website at http://www.ubswarburg.com
>
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mail transmission cannot be guaranteed to be secure or error-free
> as information could be intercepted, corrupted, lost, destroyed,
> arrive late or incomplete, or contain viruses. The sender therefore
> does not accept liability for any errors or omissions in the contents
> of this message which arise as a result of e-mail transmission. If
> verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities or
> related financial instruments.
>
>
> --
> Gllug mailing list - Gllug at linux.co.uk
> http://list.ftech.net/mailman/listinfo/gllug
>
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list