Perl en Español

  1. Home
  2. Tutoriales
  3. Foro
  4. Artículos
  5. Donativos
  6. Publicidad
 
Índice general » Mundo Perl » Web » Cómo llamo a mi CGI en Lycos Responder al tema
Nuevo tema


Página 1 de 1  [ 2 mensajes ] 
 
Nota 2009-11-08 16:47 @741

Perlero Senior
Registrado: 2009-03-01 18:39 @818
Mensajes: 387
Cómo llamo a mi CGI en Lycos
Hola. Tengo una duda de cómo llamar mi script CGI en Lycos, porque tengo el siguiente código HTML.

Syntax: [ Download ] [ Hide ]
Using html4strict Syntax Highlighting
  1. <html><title>Scanner Port by Guason</title>
  2. <BODY text=#006600>
  3. <style type="text/css">
  4. body {
  5.         background-color: #000000;
  6.        
  7.         background-repeat: repeat-y;
  8.         margin-left: 0px;
  9.         margin-top: 0px;
  10. }
  11. .posthidden {display:none} .postshown {display:inline}
  12. -->
  13. </style>
  14. <script type="text/Javascript">
  15. function expandcollapse (postid) {
  16. whichpost = document.getElementById(postid);
  17. if (whichpost.className=="postshown") { whichpost.className="posthidden"; }
  18. else { whichpost.className="postshown"; }
  19. }
  20. </script>
  21.  
  22. <center><h1></h1><br><br><br>
  23. <form action="http://guasoncracker.super-red.es/cgi-bin/hola.cgi">
  24.  
  25. IP: <input type="text" name="ip"><br><br>
  26. <input type="submit" value="VENGA!">
  27. </form>
  28. </body>
  29. </html>


También el código CGI llamado hola.cgi que está en la carpeta cgi-bin.

Syntax: [ Download ] [ Hide ]
Using perl Syntax Highlighting
  1. #!/usr/bin/perl
  2. print "Content-type: text/html\n\n";
  3. use CGI;
  4. $q = CGI->new;
  5.  
  6. print "<b>Hi broder yo funciono!</b><br>\n";
  7.  


Pero cuando le pongo los datos me demora la página y se pone en blanco o a veces pone que no existe o acceso restringido.

El problema es que ya que he seguido todos los datos del manual Lycos, pues también le dí los permisos necesarios.

La página pueden verla en http://guasoncracker.super-red.es/sa.htm.

¿Alguien me explica cómo llamar mi script CGI sin problema en Lycos?


Nota 2009-11-08 17:47 @783
Avatar de Usuario
Administrador
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España
Mensajes: 10249
Re: Cómo llamo a mi CGI en Lycos
Estás mezclando varias cosas en el CGI: si usas el módulo CGI.pm, no necesitas usar el print() primero para mandar el 'Content-type'. Luego, ejecutas el new() como si fueras a usarlo de forma orientado a objetos, pero luego no haces ningún uso de él.

El uso del módulo CGI ahorra mucho trabajo si se saben de sus posibilidades. Y hay dos formas básicas de usarlo: orientado a funciones y orientado a objetos.

De la primera forma, orientado a funciones:
Syntax: [ Download ] [ Hide ]
Using perl Syntax Highlighting
  1. #!/usr/bin/perl
  2. use CGI qw/:standard/;
  3.  
  4. print header,
  5.       start_html(),
  6.       b('Hi broder yo funciono!'), br(),"\n"
  7.       end_html()
  8.       ;


Y de la segunda forma, orientado a objetos:
Syntax: [ Download ] [ Hide ]
Using perl Syntax Highlighting
  1. #!/usr/bin/perl
  2. use CGI;
  3.  
  4. $q = CGI->new;
  5.  
  6. print $q->header,
  7.       $q->start_html(),
  8.       $q->b('Hi broder yo funciono!'), $q->br(),"\n"
  9.       $q->end_html()
  10.       ;


Las diferencias son pequeñas, pero hay que seguirlas (o una u otra, pero no mezclarlas).

Puedes probar mi CGI Mínimo para ver si te funciona bien el sistema cgi de Lycos.

Ya hemos hablado de este tema, de Lycos, antes.

_________________
JF^D Perl programming


Responder al tema  [ 2 mensajes ] 

Reglas del Foro
No puedes abrir nuevos temas en este Foro
No puedes responder a temas en este Foro
No puedes editar tus mensajes en este Foro
No puedes borrar tus mensajes en este Foro
No puedes enviar adjuntos en este Foro

Publicidad

Socializa

Síguenos por Twitter

Suscríbete GRATUITAMENTE al Boletín de Perl en Español

Saltar a:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Traducción al español por Huan Manwë para phpbb-es.com
phpBB SEO