Página 1 de 1

Formulario HTML en Perl conectado con postgreSQL

NotaPublicado: 2011-10-20 12:59 @583
por victorhugo
Buenas tardes.

El presente mensaje es para solicitar de su ayuda. Estoy desarrollando una aplicación que muestre los datos de mi BD en un formulario en HTML, pero no logro entender cómo debo decirle que cada campo se guarde o muestre o busque cada campo de diferentes tablas. El formulario es para gestionar la base de datos desde un interfaz pero los botones de agregar, modificar, buscar, eliminar. No los sé programar en Perl. Les dejo el código:

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. #!/usr/bin/perl
  2. use CGI;
  3. use DBI;
  4. use DBD::Pg;
  5. use CGI::Carp qw(fatalsToBrowser);
  6. my $dbh = DBI->connect("dbi:Pg:dbname=directorio","directorio","directorio");
  7. $sth = $dbh->prepare("SELECT institucion.name, sede.name, estado.name, customer_user.first_name, customer_user.last_name, customer_user.phone, customer_user.email FROM customer_user INNER JOIN sede ON customer_user.sede_id=sede.id JOIN institucion ON sede.id_institucion=institucion.id JOIN estado ON sede.id_estado=estado.id");
  8. $sth->execute;
  9.  
  10. print"Content-type: text/html\n\n";
  11.  print"<html>";
  12.    print"<body>";
  13.     print"<form>";
  14.       print"<p>Nombre: <input type=\"text\"name=\"text\"></p>";
  15.       print"<p>Apellido: <input type=\"text\" name=\"text\"></p>";
  16.       print"<p>Telefono1: <input type=\"text\" name=\"text\"> Telefono2: <input type=\"text\" name=\"text\"></p>";
  17.       print"<p>Email: <input type=\"text\" name=\"text\"></p>";
  18.       print"Institucion: <select name=\"institucion\"></select> ";
  19.       print"Sede : <select name\"sede\"></select> ";
  20.       print"Estado: <select name=\"estado\"></select>";
  21.       print"<p><input type=\"button\"name=\"agregar\" value=\"AGREGAR\"> <input type=\"button\"name=\"modificar\" value=\"MODIFICAR\"> <input type=\"button\"name=\"eliminar\" value=\"ELIMINAR\"> <input type=\"button\"name=\"buscar\" value=\"BUSCAR\"></p>";
  22.     print"</form>";
  23.  print"</body>";
  24. print"</html>";
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4