#!/usr/bin/php4 "; print "words of the moment\n"; for ($i=0; $i < $num; $i++) { $r = pg_fetch_row($result, $i); print "on: $r[1] the word was: \t$r[0]\n"; } print "" ?> #!/usr/bin/perl -wT use strict; use CGI; use DBI; my $cgi=new CGI; print $cgi->header(); my $word=$cgi->param('word') || 'nothing entered for perl'; # RaiseError instead of manually dying # no password needed as we are using suexec and ident server locally my $dbh=DBI->connect('dbi:Pg:dbname=felicia','felicia', "",{ RaiseError => 1}); my $query="INSERT INTO hello VALUES (?);"; my $sth=$dbh->prepare($query); $sth->execute($word); $query=$query="SELECT word,to_char(when_hello,'Month DD HH24:MI:SS') FROM hello;"; $sth=$dbh->prepare($query); $sth->execute(); print '
';
while (my @r=$sth->fetchrow_array()){
    print "on: $r[1] the word was: \t$r[0]\n";
}
print '
'; $dbh->disconnect();