Web Tools
Web Tools
От:
"Ronald L. Chichester" <complaw@hal-pc.org>
Дата:
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
Re: Web Tools
От:
jutta staudach <jutta.staudach@jez.at>
Дата:
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 "", "\n";
print "","\n";
print "","\n";
print "", "\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 "", "\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
Re: Web Tools
От:
J J <linux2000@hotmail.com>
Дата:
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;
Re: Web Tools
От:
"Eric T. Jennings" <ericj@pema.scs.unr.edu>
Дата:
J J 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