Thread: Web Tools
Hi: I want to use PostgreSQL as a database engine for a web-based intranet (using Apache on Linux). Is there a repository of CGI examples that I could use, or are there some software tools that could take out some of the time and grunt work? Thanks in advance, Ron Chichester
I found no examples, but a very good description in the Pg.pm file here is a example for a local database: #!/usr/bin/perl print "Content-type: text/html", "\r\n\r\n"; print "<HTML>", "\n"; print "<HEAD><TITLE></TITLE></HEAD>","\n"; print "<body bgcolor=#FFFFFF link='#0000FF'vlink='#800080'>","\n"; print "<BODY>", "\n"; require Pg; $conn = Pg::connectdb("dbname=postgres"); Pg::doQuery($conn, "select * from probe", \@ary); for $i ( 0 .. $#ary ) { for $j ( 0 .. $#{$ary[$i]} ) { print "$ary[$i][$j]\t"; } print "\n"; } print "</BODY></HTML>", "\n"; exit(0); Ciao Jutta Ronald L. Chichester schrieb: > Hi: > > I want to use PostgreSQL as a database engine for a web-based intranet > (using Apache on Linux). Is there a repository of CGI examples that I > could use, or are there some software tools that could take out some of > the time and grunt work? > > Thanks in advance, > > Ron Chichester
Ronald L. Chichester wrote: > Hi: > > I want to use PostgreSQL as a database engine for a web-based intranet > (using Apache on Linux). Is there a repository of CGI examples that I > could use, or are there some software tools that could take out some of > the time and grunt work? > > Thanks in advance, > > Ron Chichester This uses the built in "print a HTML table row" function: #!/usr/bin/perl -w use Pg; use CGI; $wp = new CGI; $custname = uc $wp->param('custname'); print $wp->header; print $wp->start_html(-author=>"jj"); $conn = Pg::connectdb("dbname = john"); if ($conn->status != PGRES_CONNECTION_OK) { die("Can't connect"); } $res = $conn->exec("select * from workorder where name like '%$custname%'"); #fout, header, align, standard, html3, expanded, pager, fieldSep, tableOpt, caption, ... $res->print (STDOUT, "", "", 0, 1, 0, 0, "|", "border=1", "Customers"); print $wp->end_html;
J J <linux2000@hotmail.com> wrote: : Ronald L. Chichester wrote: :> Hi: :> :> I want to use PostgreSQL as a database engine for a web-based intranet :> (using Apache on Linux). Is there a repository of CGI examples that I :> could use, or are there some software tools that could take out some of :> the time and grunt work? :> :> Thanks in advance, :> :> Ron Chichester Take a look at PHP-3. It's a killer middleware HTML parser that loads as an Apache module, and will make your intranet development life much easier. www.php.net -- Eric