Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/06/2004, 00:37
Cristhian101
 
Fecha de Ingreso: junio-2004
Mensajes: 15
Antigüedad: 19 años, 11 meses
Puntos: 0
Ayuda con linea "print HTML"

Tengo este código. El tema es que cada vez que alguien vota (Es una encuesta) abre una ventana que indica que resultado tuvo su voto. Yo no quiero que aparezca ninguna ventana. Osea no quiero el print HTML. Como hago?

Aca va el código:
#!/usr/bin/perl
##Path to CGI Bin - Might have to change -Ask your ISP for the path to Perl.

$PathLoadVar = "/home/usuario/www/flash.txt";
############End things you need to change###Anything and everything else does not need to
####be changed but it's probabably a good idea.

#Parse the Data from the Flash Movie
&Parse_Form;
$votename = $formdata{'votename'};
$no1 = $formdata{'no1'};
$no2 = $formdata{'no2'};
$no3 = $formdata{'no3'};
$no4 = $formdata{'no4'};
$no5 = $formdata{'no5'};
$no6 = $formdata{'no6'};
$no7 = $formdata{'no7'};
$no8 = $formdata{'no8'};

#### Writes LoadVar.txt for input to Flash######
open (LOG, ">$PathLoadVar") || &ErrorMessage;
#Puts Variables into Form Flash can read#
@Load = ("votename=$votename&no1=$no1&no2=$no2&no3=$no3&no 4=$no4&no5=$no5&no6=$no6&no7=$no7&no8=$no8&vend=ve nd");
print LOG "@Load\n";
close (LOG);
#####End Write LoadVar####

##This prints out the content to the cgi page you see after the variables have been ##submitted. Make sure to change the coloradoboarders.com stuff to your own stuff.

print "Content-type: text/html\n\n";
print <<"HTML code";
<HTML><HEAD>
<TITLE>Votes</TITLE>
</HEAD><BODY>
<P>Gracias por tu voto!</P>
<P><form><input type=button value=\"Close Window\" onclick=\"window.close()\;\"></form></P>
<P>Tu voto fué registrado. Ya podes cerrar esta ventana.</P>
</BODY></HTML>

HTML code

###########Parses Variables #### No Need to Change ######
sub Parse_Form {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);

if ($ENV{'QUERY_STRING'}) {
@getpairs =split(/&/, $ENV{'QUERY_STRING'});
push(@pairs,@getpairs);
}
} else {
print "Content-type: text/html\n\n";
print "<P>Use Post or Get";
}

foreach $pair (@pairs) {
($key, $value) = split (/=/, $pair);
$key =~ tr/+/ /;
$key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~s/<!--(.|\n)*-->//g;

if ($formdata{$key}) {
$formdata{$key} .= ", $value";
} else {
$formdata{$key} = $value;
}
}
}
1;


Gracias!!! Muchas