comoquieras
Programmer
Hi all, I have a problem with a few perl scripts when I am using web browsers, such as Netscape 4.7 or Internet Explorer 5.5
The problem is as follows... when I follow a link in a form (or in a plain html page) to a perl script, sometimes a window pops up asking me if I want to save the perl script.
(of course, that's the only thing it allows me to do, I mean, I cannot run the perl script)
For example, when I follow a link with the following code:
<a HREF="/frontal/scripts/correo_nuevo.pl" TARGET="_top">Correo</a>
Netscape asks me to save a file called correo_nuevo.exe (sometimes exe sometimes pl) with the following code:
<html>
<head>
<title>Correo</title>
</head>
<BODY>
<br>
</center>
</body>
<script language=javascript>
document.location = "../usuarios/IGA051/fechlist.html"
</script>
</html>
And nothing else happens.
This is part of the ASP code that builds the previous HTML code:
# servicios.pl
#
#
$nummaxmsg = 100;
$buzonesims = something
$buzoneshtm = something
$baseweb = something
$usuario = $ENV{AUTH_USER}; $usuario =~ s/^.*\\(.*)$/$1/;
$host=$ENV{SERVER_NAME};
### aqui se almacenan los enlaces a los logos en funcion del IdSer:
### comprobamos si hay mensajes sin convertir y en su caso redirigimos:
if (&mensajessinconvertir) {
print "Location: $baseweb/scripts/comprobandomensajes.asp\n\n";
exit;
};
### obtenemos numero de mensajes sin leer:
$nummensajes = &nummensajessinleer;
use Win32::ODBC;
$dba = new Win32::ODBC("DSN=ssomething;UID=something;PWD=something"
;
if (!defined $dba) { die "No se pudo abrir la base de datos (PC)"; };
$dba->Sql("Select Config
from conrreo
where IdUsuario='$usuario'
"
;
$dba->FetchRow();
my $config = $dba->Data("Config"
;
print ("Config= '$config' "
;
$dba->Close();
my $indicecorreo = (($config & 4)?'fech':'').(($config & 2)?'auto':'').(($config & 1)?'asun':'').'list.html';
#-------------------------------------------------------------------------
print <<END;
Content-Type: text/html
<html>
<head>
<title>Correo</title>
</head>
<BODY>
<br>
</center>
</body>
<script language=javascript>
document.location = "../usuarios/$usuario/$indicecorreo"
</script>
</html>
END
#-------------------------------------------------------------------------
##########################################################################
sub nummensajessinleer
{
my $convertidos = 0;
open(UIDLS, "$buzoneshtm$usuario\\uidls.txt"
;
# || die("No se puede abrir el estado del correo HTML de '$usuario'"
;
while (<UIDLS>) { last if (/^;convertidos/); };
while (<UIDLS>) {
chop;
last if ($_ eq ""
;
$convertidos++;
};
close(UIDLS);
return $convertidos;
}
sub mensajessinconvertir
{
my @listado, $uidls, $tmp;
### obtenemos directorio del buzon IMS -> @listado + @tmphash
if (! opendir(HANDLEDIR, "$buzonesims$usuario"
) {
print ("No se puede abrir el directorio de correo IMS de '$usuario'"
;
return;
}
@listado = readdir(HANDLEDIR);
closedir(HANDLEDIR);
shift @listado; # quitamos '.'
shift @listado; # quitamos '..'
my @tmphash = reverse( sort(@listado) );
@listado = splice ( @tmphash, 0, $nummaxmsg );
open(UIDLS, "$buzoneshtm$usuario\\uidls.txt"
;
# || die("No se puede abrir el estado del correo HTML de '$usuario'"
;
$uidls = join ("", <UIDLS>);
close(UIDLS);
my $flag = 0;
foreach $tmp (@listado) {
$uidls =~ m/$tmp/ || do {
$flag = 1; goto FIN;
};
};
FIN: return $flag;
}
sub htmliza
{
$_ = shift;
#s//Á/g; # Á
#s//É/g; # É
#s//Í/g; # Í
#s//Ó/g; # Ó
#s//Ú/g; # Ú
s/ß/á/g; # á
s/Ú/é/g; # é
s/Ý/í/g; # í
s/¾/ó/g; # ó
s/·/ú/g; # ú
#s//Ñ/g; # Ñ
s/±/ñ/g; # ñ
s/¬/ª/g; # ª
s/¦/ü/g; # ü
return $_;
}
1;
Any hints?
Thanks
[sig][/sig]
The problem is as follows... when I follow a link in a form (or in a plain html page) to a perl script, sometimes a window pops up asking me if I want to save the perl script.
(of course, that's the only thing it allows me to do, I mean, I cannot run the perl script)
For example, when I follow a link with the following code:
<a HREF="/frontal/scripts/correo_nuevo.pl" TARGET="_top">Correo</a>
Netscape asks me to save a file called correo_nuevo.exe (sometimes exe sometimes pl) with the following code:
<html>
<head>
<title>Correo</title>
</head>
<BODY>
<br>
</center>
</body>
<script language=javascript>
document.location = "../usuarios/IGA051/fechlist.html"
</script>
</html>
And nothing else happens.
This is part of the ASP code that builds the previous HTML code:
# servicios.pl
#
#
$nummaxmsg = 100;
$buzonesims = something
$buzoneshtm = something
$baseweb = something
$usuario = $ENV{AUTH_USER}; $usuario =~ s/^.*\\(.*)$/$1/;
$host=$ENV{SERVER_NAME};
### aqui se almacenan los enlaces a los logos en funcion del IdSer:
### comprobamos si hay mensajes sin convertir y en su caso redirigimos:
if (&mensajessinconvertir) {
print "Location: $baseweb/scripts/comprobandomensajes.asp\n\n";
exit;
};
### obtenemos numero de mensajes sin leer:
$nummensajes = &nummensajessinleer;
use Win32::ODBC;
$dba = new Win32::ODBC("DSN=ssomething;UID=something;PWD=something"
if (!defined $dba) { die "No se pudo abrir la base de datos (PC)"; };
$dba->Sql("Select Config
from conrreo
where IdUsuario='$usuario'
"
$dba->FetchRow();
my $config = $dba->Data("Config"
print ("Config= '$config' "
$dba->Close();
my $indicecorreo = (($config & 4)?'fech':'').(($config & 2)?'auto':'').(($config & 1)?'asun':'').'list.html';
#-------------------------------------------------------------------------
print <<END;
Content-Type: text/html
<html>
<head>
<title>Correo</title>
</head>
<BODY>
<br>
</center>
</body>
<script language=javascript>
document.location = "../usuarios/$usuario/$indicecorreo"
</script>
</html>
END
#-------------------------------------------------------------------------
##########################################################################
sub nummensajessinleer
{
my $convertidos = 0;
open(UIDLS, "$buzoneshtm$usuario\\uidls.txt"
# || die("No se puede abrir el estado del correo HTML de '$usuario'"
while (<UIDLS>) { last if (/^;convertidos/); };
while (<UIDLS>) {
chop;
last if ($_ eq ""
$convertidos++;
};
close(UIDLS);
return $convertidos;
}
sub mensajessinconvertir
{
my @listado, $uidls, $tmp;
### obtenemos directorio del buzon IMS -> @listado + @tmphash
if (! opendir(HANDLEDIR, "$buzonesims$usuario"
print ("No se puede abrir el directorio de correo IMS de '$usuario'"
return;
}
@listado = readdir(HANDLEDIR);
closedir(HANDLEDIR);
shift @listado; # quitamos '.'
shift @listado; # quitamos '..'
my @tmphash = reverse( sort(@listado) );
@listado = splice ( @tmphash, 0, $nummaxmsg );
open(UIDLS, "$buzoneshtm$usuario\\uidls.txt"
# || die("No se puede abrir el estado del correo HTML de '$usuario'"
$uidls = join ("", <UIDLS>);
close(UIDLS);
my $flag = 0;
foreach $tmp (@listado) {
$uidls =~ m/$tmp/ || do {
$flag = 1; goto FIN;
};
};
FIN: return $flag;
}
sub htmliza
{
$_ = shift;
#s//Á/g; # Á
#s//É/g; # É
#s//Í/g; # Í
#s//Ó/g; # Ó
#s//Ú/g; # Ú
s/ß/á/g; # á
s/Ú/é/g; # é
s/Ý/í/g; # í
s/¾/ó/g; # ó
s/·/ú/g; # ú
#s//Ñ/g; # Ñ
s/±/ñ/g; # ñ
s/¬/ª/g; # ª
s/¦/ü/g; # ü
return $_;
}
1;
Any hints?
Thanks
[sig][/sig]