Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/09/2005, 09:15
Avatar de Twity
Twity
 
Fecha de Ingreso: agosto-2002
Mensajes: 86
Antigüedad: 22 años, 7 meses
Puntos: 0
Hola Datacenter1. Gracias por la respuesta pero tengo mas dudas que problemas:

Diseño mis script con un programa llamado PerlBuilder, me es muy util y práctico, nunca me da errores ni tengo problemas de programacion (ya que mis conocimientos de programacion son reducidos).

El tema es que no se como hacer para que:
- el script inicialize cualquier variable utilizada
- el script solo puede ser usado desde tu dominio y no explotado remotamente

Te pego una copia de unos de los script que estoy teniendo problemas a ver si me podrás ayudar gracias de antemano:

#!/usr/bin/perl
$mail_prog = '/opt/exim/bin/exim -t' ;

&GetFormInput;

$nombre = $field{'nombre'} ;
$email = $field{'email'} ;
$confirmacion = $field{'confirmacion'} ;
$telefono = $field{'telefono'} ;
$localidad = $field{'localidad'} ;
$pais = $field{'pais'} ;
$comentario = $field{'comentario'} ;
$Submit = $field{'Submit'} ;

$recip = "info\@laolaweb.com.ar" ;

open (MAIL, "|$mail_prog -t");
print MAIL "To: $recip\n";
print MAIL "Reply-to: \"$nombre\" <$email>\n";
print MAIL "From: \"$nombre\" <$email>\n";
print MAIL "Subject: Consulta QUIERO UNA WEB\n";
print MAIL "\n\n";
print MAIL "Consulta QUIERO UNA WEB\n" ;
print MAIL "\n" ;
print MAIL "Email: ".$email."\n" ;
print MAIL "Confir:".$confirmacion."\n" ;
print MAIL "Nombre:".$nombre."\n" ;
print MAIL "Tel: ".$telefono."\n" ;
print MAIL "".$localidad.", ".$pais."\n" ;
print MAIL "\n" ;
print MAIL "\n" ;
print MAIL "Comentario:".$comentario."\n" ;
print MAIL "\n" ;
print MAIL "Eso es todo.\n" ;
print MAIL "\n\n";
close (MAIL);

print "Content-type: text/html\n\n";
print "<html>\n" ;
print "<head>\n" ;
print "<title>La Ola</title>\n" ;
print '<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">'."\n" ;
print "<meta content=text/css http-equiv=Content-Style-Type>\n" ;
print '<script language="JavaScript">'."\n" ;
print "\n" ;
print "function right(e) {\n" ;
print "if (navigator.appName == \'Netscape\' && \n" ;
print "(e.which == 3 || e.which == 2))\n" ;
print "return false;\n" ;
print "else if (navigator.appName == \'Microsoft Internet Explorer\' && \n" ;
print "(event.button == 2 || event.button == 3)) {\n" ;
print 'alert("Página protegida por La Ola. Todos los derechos reservados. ");'."\n" ;
print "return false;\n" ;
print "}\n" ;
print "return true;\n" ;
print "}\n" ;
print "\n" ;
print "document.onmousedown=right;\n" ;
print "document.onmouseup=right;\n" ;
print "if (document.layers) window.captureEvents(Event.MOUSEDOWN);\n" ;
print "if (document.layers) window.captureEvents(Event.MOUSEUP);\n" ;
print "window.onmousedown=right;\n" ;
print "window.onmouseup=right;\n" ;
print "</script>\n" ;
print '<style type="text/css"><!--'."\n" ;
print "-->\n" ;
print "</style>\n" ;
print '<link rel="stylesheet" href="styles.css">'."\n" ;
print "</head>\n" ;
print '<body bgcolor="#000033" onLoad="">'."\n" ;
print '<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000066">'."\n" ;
print " <tr> \n" ;
print ' <td width="20"><img src="http://www.laolaweb.com.ar/esquina_sup_isq.gif" width="20" height="20"></td>'."\n" ;
print ' <td colspan="2" nowrap background="http://www.laolaweb.com.ar/bordes_arriba.gif">&nbsp;</td>'."\n" ;
print ' <td width="20"><img src="http://www.laolaweb.com.ar/esquina_sup_derecha.gif" width="19" height="20"></td>'."\n" ;
print " </tr>\n" ;
print " <tr> \n" ;
print ' <td rowspan="18" width="20" background="http://www.laolaweb.com.ar/bordes_izq.gif">&nbsp;</td>'."\n" ;
print ' <td colspan="2" rowspan="18" align="center" class="unnamed1" valign="top"> '."\n" ;
print ' <table width="480" border="0" cellspacing="0" cellpadding="0">'."\n" ;
print " <tr> \n" ;
print ' <td rowspan="2" width="1">&nbsp;</td>'."\n" ;
print ' <td width="100" nowrap align="center"> '."\n" ;
print ' <div align="center"><font face="Tahoma" size=1 color="#ffffff"><b><font color="#CCCCCC" face="Arial, Helvetica, sans-serif"> '."\n" ;
print ' </font><font face="Arial," size=1 color="#000000" helvetica,="undefined" sans-serif="undefined"><a href="http://www.laolaweb.com.ar"><img src="http://www.laolaweb.com.ar/marca_laola.gif" width="100" height="40" border="0"></a></font></b></font></div>'."\n" ;
print " </td>\n" ;
print ' <td colspan="2" nowrap bgcolor="#000066" valign="top"> '."\n" ;
print ' <div align="right"></div>'."\n" ;
print " </td>\n" ;
print " </tr>\n" ;
print " <tr> \n" ;
print ' <td width="100" nowrap align="center"> '."\n" ;
print ' <div align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#CCCCCC">web '."\n" ;
print " &amp; design</font></div>\n" ;
print " </td>\n" ;
print ' <td colspan="2" nowrap>&nbsp; </td>'."\n" ;
print " </tr>\n" ;
print " <tr> \n" ;
print ' <td width="1">&nbsp;</td>'."\n" ;
print ' <td colspan="3" nowrap> '."\n" ;
print ' <div align="center"><img name="Image14" src="http://www.laolaweb.com.ar/linea.gif" width="475" height="5"></div>'."\n" ;
print " </td>\n" ;
print " </tr>\n" ;
print " </table>\n" ;
print ' <table border="0" cellspacing="0" cellpadding="0" width="450">'."\n" ;
print " <tr> \n" ;
print ' <td colspan="5"> '."\n" ;
print " <blockquote> \n" ;
print ' <p align="center"><font color="#FFFFFF" size="4" face="Arial, Helvetica, sans-serif">Gracias '."\n" ;
print ' <font size="5"><b><font size="4">'.$nombre.'</font></b></font> </font></p>'."\n" ;
print ' <p align="center"><font color="#FFFFFF" size="4" face="Arial, Helvetica, sans-serif">por '."\n" ;
print " solicitar los productos de <i>La Ola</i></font></p>\n" ;
print ' <p align="center"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><font size="5" color="#FFFFFF"><b>P</b></font><b><font color="#CCCCFF">ronto '."\n" ;
print ' recibirá un mensaje en <font color="#FFFFFF">'.$email.'</font> confirmando '."\n" ;
print " su pedido. Si no recibe dicha confirmación, puede ser que haya \n" ;
print ' escrito su dirección de <font color="#FFFFFF">correo electrónico</font> '."\n" ;
print " incorrectamente. Si esto sucede, por favor regrese a la página \n" ;
print " previa y re-envíe su información teniendo en cuenta que algunos \n" ;
print " datos son requeridos para procesar su inquietud.</font></b></font></p>\n" ;
print ' <p align="center"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><font color="#CCCCFF">O '."\n" ;
print ' escr&iacute;banos un email a </font><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><font color="#CCCCFF"><b><a href="mailto:[email protected]">[email protected] om.ar</a></b></font><b></b></font><b><br>'."\n" ;
print " </b></font></p>\n" ;
print ' <p align="right"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"> '."\n" ;
print ' </font><font face="Arial, Helvetica, sans-serif" size="2" color="#CCCCFF"><a href="http://laolaweb.com.ar">ir '."\n" ;
print " a la P&aacute;gina Principal</a></font></p>\n" ;
print " </blockquote>\n" ;
print " </td>\n" ;
print " </tr>\n" ;
print " </table>\n" ;
print " </td>\n" ;
print ' <td rowspan="18" width="20" background="http://www.laolaweb.com.ar/bordes_derecha.gif">&nbsp;</td>'."\n" ;
print " </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> </tr>\n" ;
print " <tr> \n" ;
print ' <td width="20"><img src="http://www.laolaweb.com.ar/esquina_inferior_izquierda.gif" width="20" height="20"></td>'."\n" ;
print ' <td colspan="2" nowrap><img src="http://www.laolaweb.com.ar/marca_con_brillo.gif" width="480" height="20"></td>'."\n" ;
print ' <td width="20"><img src="http://www.laolaweb.com.ar/esquina_inferior_derecha.gif" width="20" height="20"></td>'."\n" ;
print " </tr>\n" ;
print "</table>\n" ;
print '<p align="center"><font color="#999999" face="Arial, Helvetica, sans-serif" size="1">La '."\n" ;
print " Ola, web &amp; design - Todos los derechos reservados</font></p>\n" ;
print "</body>\n" ;
print "</html>\n" ;

sub GetFormInput {

(*fval) = @_ if @_ ;

local ($buf);
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN,$buf,$ENV{'CONTENT_LENGTH'});
}
else {
$buf=$ENV{'QUERY_STRING'};
}
if ($buf eq "") {
return 0 ;
}
else {
@fval=split(/&/,$buf);
foreach $i (0 .. $#fval){
($name,$val)=split (/=/,$fval[$i],2);
$val=~tr/+/ /;
$val=~ s/%(..)/pack("c",hex($1))/ge;
$name=~tr/+/ /;
$name=~ s/%(..)/pack("c",hex($1))/ge;

if (!defined($field{$name})) {
$field{$name}=$val;
}
else {
$field{$name} .= ",$val";

#if you want multi-selects to goto into an array change to:
#$field{$name} .= "\0$val";
}


}
}
return 1;
}
__________________
www.laolaweb.com.ar
http://www.laolaweb.com.ar/marca_laola.gif
Gestión para la comercialización en la web