Trouble with PG.pm Interface via browser - Mailing list pgsql-general

From harris justin
Subject Trouble with PG.pm Interface via browser
Date
Msg-id 19990807101507.6123.cpmta@c004.sfo.cp.net
Whole thread Raw
Responses JDBC
List pgsql-general
Hello

I am developing an interface to Postgres via a browser and am
having trouble getting and perl scripts called from a "POST"
method to connect to the database.
When run from the command prompt the script will connect OK.
 When run from the browser nothing is returned and the request
times out after a period of time.
I am running postgres with SUSE 5.3.  The httpd daemon runs
under user:wwwrun group:daemon.  I have checked that under this
user ID I can connect to the database from the command line
but not from the browser. I have a browser interface using the C Library's running Ok under the same UID and group.

I took the following code from one of the posted messages to
check that I was not missing anything obvious. Is there something
obvious that I am missing here.

Can anyone help?

#!/usr/bin/perl

use Pg;

# read (STDIN, $cmdline, $ENV{'CONTENT_LENGTH'});
$cmdline = <STDIN>;

@pairs = split (/&/, $cmdline);
foreach $pair (@pairs){
($name, $value) = split (/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack ("C", hex($1))/eg;
}
print "Content-type:text/html\n\n";

print <<EOM;
<HTML>
<BODY>
<BR>
EOM


$con=PQsetdb('','','','','soft');
$errmsg = PQerrorMessage ( $con );
if ($errmsg ne '')
{
print ($errmsg);
}

PQfinish($con);

print <<EOM;
</BODY>
</HTML>
EOM

pgsql-general by date:

Previous
From: Thomas Good
Date:
Subject: SQL-Ledger new version (fwd)
Next
From: Michael Simms
Date:
Subject: Bug Report