RE: [PHP-DB] Fatal error: Call to undefined function: pg_connect() in ...

2001-10-29 Thread Fotwun

Compile a dynamic module for use with the dl() function or the php.ini.

./configure --with-pg=shared
make

cp the module in the src/module (pgsql.so) into the location defined for
modules in your php.ini.

either add line to the ini or use the dl('pgsql.so') in your script to call
it.

if you are using a windows box i'm not sure what you do, besides first
switching to an open source OS =). they may already have binaries for
windows modules, though in my experience on unix boxes is that it compares
the the version of php you are running against the version it was compiled
with. if they are different it will error. so watch for that if you find a
compiled module to use. if you do not have access to modify the ini or place
files in the appropriate library directory you will have to request your
admin to do it. if they do not you will need to find another host or use
your own server.

> -Original Message-
> From: Rodolfo Napoles [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 29, 2001 1:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Fatal error: Call to undefined function:
> pg_connect() in ...
>
>
> Is there a way to configure php (through the conf file?) to support the pg
> commands? Is there a manual (link) where I can find how to
> compile postgreSQL
> support into PHP? does it mean to compile PHP ?
>
> Thanks
>
> Rick Emery wrote:
>
> > This means that PostgreSQL support was NOT compiled into PHP.
> Therefore,
> > you cannot use PostgreSQL commands.
> >
> > -Original Message-
> > From: Rodolfo Napoles [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 29, 2001 2:17 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Fatal error: Call to undefined function: pg_connect()
> > in ...
> >
> > Hello,
> >
> > I am trying to run my first php script to connect to a PostgreSQL
> > database on a Linux box with apache web server.
> >
> > When I try to load the page with the browser i get the following error:
> >
> > Fatal error: Call to undefined function: pg_connect() in
> > /dirname/tryit.php on line 9
> >
> > I was able to create tables on the database via the webadmin tool, so I
> > know that postgres is running properly.
> >
> > Here is my code.
> >
> > 
> > 
> > TESTING PHP4 with PG
> > 
> > 
> > Testing connection to Postgres using php4 from
> > an apache webserver on Linux Mandrake 8.0
> >  >$conn = pg_connect("host=localhost dbname=databasename");
> >if (! $conn) { ?>
> >Can not open connection to Database, contact the site
> > administrator   >   }
> >else
> >   {
> >   $SQL = "SELECT * FROM TABLENAME";
> >   $rs = pg_query($SQL, $conn);
> >   if (! $rs) {?>
> >   Can not execute SQL statement, contact the site
> > administrator   >   }
> >   else
> >   {
> >  do {
> >  while ($row = pg_fetch_row($rs)) { ?>
> > > }
> >  } while (pg_next_result($rs));
> >  pg_freeresult($rs);
> >  pg_close ($conn);
> >}
> >}
> > ?>
> > 
> > 
> >
> > Thanks in advance
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] E-Commerce - Integrating Sessions With Charging Processes That rePOST

2001-08-20 Thread Fotwun

How, code wise do I retreive the session data from the session id. Also,
another response below said HTTP_REFERRER is not secure. So how do people
who use this type of payment gateway secure the script it redirects to. All
of the data it sends is form data, so once somebody new what script it
redirects to, and what form data it posts, it would be quite easy for them
to authorize their own charges in my opinion.

I think the more I think about this, the POST/REDIRECT type of gateway is
pretty hooky. I would like someones input who actually uses this type of
gateway and how it is secured and how they maintain their sessions that
correlate to that broswer.

I think I just need to find a company with more reasonable rates that allow
direct socket authorization. Any recommendations on that?

> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 12:43 PM
> To: Fotwun; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] E-Commerce - Integrating Sessions With Charging
> Processes That rePOST
>
>
> - Original Message -
> From: Fotwun <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, August 20, 2001 1:40 PM
> Subject: [PHP-DB] E-Commerce - Integrating Sessions With Charging
> Processes
> That rePOST
>
>
> > Hi,
> >
> > I have basically seen and used two methods for integrating credit card
> > gateways into PHP code.
> >
> > The first method is one that opens a socket to the gateway server and
> sends
> > the data from within the code.
> >
> > The second is where FORM data is posted to a https URL with the URL is
> > should send the response back to, with the confirmation code, etc.
>
> [snip]
>
> > Because the clients order id that is generated will be stored as a
> session,
> > I need a way to reference the order ID and confirmation code that is
> > returned by the posted data from the gateway, against the
> session data to
> > start inserting the data into the DB if it was a successful charge.
>
> You can store the session-id in the return URL.
>
> regards
> --
> Jason Wong
> Gremlins Associates
> www.gremlins.com.hk
>
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] E-Commerce - Integrating Sessions With Charging Processes That rePOST

2001-08-19 Thread Fotwun

Hi,

I have basically seen and used two methods for integrating credit card
gateways into PHP code.

The first method is one that opens a socket to the gateway server and sends
the data from within the code.

The second is where FORM data is posted to a https URL with the URL is
should send the response back to, with the confirmation code, etc.

I traditionally use PG for situations of e-commerce, mainly because of
transactions. I like the first method better, because I feel it is more
secure, seemless, and less chance for errors to occur (either user induced,
or other problems). I like being able to store all of the required data in
sessions (rather than adding to the DB at each step) and then making all of
the transactional queries at the end of the credit card charging process.

The problem I face is that all of the companies I've researched that allow
direct socket integration seem to charge quite a bit more in general than
those that use the POST/REDIRECT method of charging.  So, if anyone
knows of a reliable and affordable company that allows socket integration,
that would solve the problem best. 

However, because of budget issues, I may need to use one of these cheaper
companies, who ultimately use the POST/REDIRECT method.

My questions are how do you securly, reliably, and seemlessly integrate
sessions within that type of gateway. Because once the form data is posted
to the credit card gateway, it redirects (posts response data) back to the
script of your choice. However, in my experience, the sessions are not
restored/recognized until the browser is refreshed on the client side
(through the use of JavaScript) to get the server to recognize the request
as coming from your user, rather than the as a post from the gateway. I
don't want to have to deal with getting sloppy and adding additional
refreshes/java script if thats the only way to do it. If I were to merely
have the code generate a form based on hidden tags and have javascript
auto-form submit, then I would open to security problems, because I could no
longer restrict the script the gateway respondes to by an HTTP_REFFER.

Because the clients order id that is generated will be stored as a session,
I need a way to reference the order ID and confirmation code that is
returned by the posted data from the gateway, against the session data to
start inserting the data into the DB if it was a successful charge.

Any ideas...? Maybe there's a quick solution out there I am just
overlooking. The solution would be easy if I wasn't inserting all of my data
at the end of the process based on the session data. But this is how the
code is has to work, so what do you all think, how should I deal with this?

Thanks,

FT


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]