develooper Front page | perl.beginners | Postings from January 2002

RE: What's wrong with this?

From:
Nikola Janceski
Date:
January 24, 2002 13:31
Subject:
RE: What's wrong with this?
Message ID:
1449413DA482D311B67000508B5A12F50592DC0E@nyexchange01.summithq.com
should be:

# imprime html.
print <<WEB_page;

Content-type: text/html


<!doctype html public "-//w3c//dtd html 3.2 final//en">
<html>

YOU should use the CGI module.. (makes life very easy!)


-----Original Message-----
From: Eduardo Cancino [mailto:lalo@ciceana.org.mx]
Sent: Thursday, January 24, 2002 9:25 AM
To: beginners@perl.org
Subject: What's wrong with this?


Hi everybody!

The next script runs looks pefectly in IE but in Netscape it shows the
source of the html...

#!c:/perl/bin/perl.exe

# recibe la forma.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);

# inicia variables.
$to = "info\@domain.mx";
$from = "info\@domain.mx";
$subject = "Comentarios Sitio Web";

# manda el mail.
open (MAIL,"|mail $to");
print MAIL <<"END_top";

"To: $to
Reply-To: $to:
Subject: $subject"

END_top

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;

   if ($form{$name} ne "" && $form{$name} ne "no" && $name ne 'enviar') {
      print MAIL $name . " = ". $form{$name} . "\n";
  }
}

close MAIL;

# imprime html.
print <<WEB_page;

Content-type: text/html
<!doctype html public "-//w3c//dtd html 3.2 final//en">
<html>
<head>
<title>Ciceana - Gracias</title>
</head>
<body bgcolor='ffffff'>
<center>
<h1><font class='covitur'>Domain</font></h1>
</center>
<br>
<center>
<font>Has sido registrado</font>
</center>
<br>
<center>
<font>Gracias!</font>
</center>
<br>
<center>
<font face='Verdana' fgcolor='00006' size='2'><a
href='../index.html'>regresar<a>
<enter>
</body>
</html>

WEB_page
exit;


Thanks, Lalo.


-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About