Trouble with PG.pm Interface via browser

From: harris justin <justin(dot)harris(at)barclays(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Trouble with PG.pm Interface via browser
Date: 1999-08-07 10:15:07
Message-ID: 19990807101507.6123.cpmta@c004.sfo.cp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Howie 1999-08-07 13:06:57 table aliasing problem with 6.5...
Previous Message Kaare Rasmussen 1999-08-07 09:57:29 Re: [GENERAL] ElephantWear Now Available...