On Thu, 24 Jul 2003, Dan Muey wrote:
> > > print $a->header('text/html');
> >
> > Even after removing all the arguments inside the header i got
> > the same
> > error.This is true even without specifying new line as in the
> > second case.
>
>
> Ok then, make sure there's no output before that header() line.
> Make sure the web server is configured properly to run the script
> the way you're expecting and that you'e script is configured to
> run properly.
When i run the below code there is no problem for me.The server do not show
any error message.
#!/usr/bin/perl
#perl reads the form data through the STDIN using the env,variable $ENV
print "Content-Type:text/html\n\n";
print "<html>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html
charset=x-user-defined\">";
read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
#All the post parameters are separated by &
@pairs=split(/&/,$buffer);
foreach $pair(@pairs)
{
($name,$value)=split(/=/,$pair);
$value=~tr/+//;
#every hex pair is back equivalent to its ascii;
$value=s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$form{$key}=$value;
}
foreach $key(keys %form)
{
print qq/$key $form{$key}\n/;
}
> What is the output form the command line?
I executed the script in the command line as
perl cgi1.pl name="mks"
and i got the output as below.
Content-Type: text/html; charset=ISO-8859-1
mks
Thanks,
visu
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]