I am having a problem with retrieving data from a form.
My code looks like this
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
require ("cgi-lib.pl");
if (&ReadParse) {
print "i_perl rules";
} else {
print "u_perl rules";
}
When I comment the if loop it doesnt give me a problem but if uncommented it doesnt execute either of the true or false statements.
Please help!
Thanks
Mandeep
&ReadParse(*input); The end result of your code would look like this:
#!/usr/bin/perl
require ("cgi-lib.pl");
print "Content-type: text/plain\r\n\r\n";
if (&ReadParse(*input)) {
print "i_perl rules"; }
else {
print "u_perl rules"; }
Be sure to check the documentation from [cgi-lib.berkeley.edu ]
field=value&field1=value1&field2=value2&.....
so you could try something like this
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@dbinfo=split(/&/, $buffer);
foreach $info(@dbinfo){
($field,$value)=split(/=/, $info);
$equipvalues{$field}=$value;
}