I need to post something to two different pages.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

I need to post something to two different pages.

Post by Luke »

Is it possible to post information to two different pages?

My problem is that I need to post my information to paypal to process it, but I also want to pass info to a page that will add it to a database.

I was going to post it to a page that the customer can not see, and then that page would record the info in the database, and post the info to paypal, but I don't know how to post to a site without using a form (I would use cURL, but it isn't set up on my server and probably won't be). Anybody got a solution?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

you can possibly use javascript but this would be a bad idea becuase a user can turn it off and throw off all your data. i would say pass the info to your page first, update the db, then pass that same info onto the paypal page using either fsockopen() or cURL (force your host to let you use cURL becuase its so much easier). that is the only way i can think of
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

using an intermediate page, you can post the data to your local script. That script outputs a second, hidden form that takes them to paypal. No Javascript required however it's possible to fiddle with the data posting that'd go to Paypal.. I've stored the information and expectations into a database field(s) in the past. Once I get a confirmation from Paypal about the correct transaction expectation the local system finishes processing the data previously stored.. I set a lifetime for the data to sit inside this "temporary" data table of about 16 - 72 hours or something to allow for delayed transactions, incomplete (but saved) orders, and vendor batching...
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

A hidden form?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

all fields are hidden types, except (maybe) the submission button..
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

feyd wrote:all fields are hidden types, except (maybe) the submission button..
Is there a way to post without a submission button? If not, I guess that will work... I can allow them to check their information before submitting it. I'd just rather not because Paypal's going to do it anyway, and then the customer will have to verify their info like 3 times.
Post Reply