Forum Moderators: coopster

Message Too Old, No Replies

Using $ GET and $ POST from same URL

Do GET and POST conflict in PHP?

         

tgilbert

1:51 am on Aug 20, 2007 (gmt 0)

10+ Year Member



I am finishing off a new payment gateway script for the Shop-script Pro shopping cart and have run into a problem reading $_POST variables being sent back from the payment processor.

I supply the payment processor (paymate) with a return URL which has some variables in the URL string (?status=success&processor=paymate).

The payment processor constructs a confirmation page with a form which uses my return URL as a form action and a set of hidden fields which details of the transaction itself.

When I try to read the POST variables, they are not there. I am trying to figure out why that might be.

One possibility is that the URL I provide has GET variables in it, so maybe the PHP receiving page recognises this and will not try to read POST variables, even though I ask it to?

Another possibility is that Shop-script does not call the actual PHP script with the $_POST array reader as the return URL, but instead uses "[domain.com]?blah" (which calls index.php and it then calls the actual PHP receiving page (adding the header/footer/etc added in the process), therefore losing the POST data?

Is one of these more likely than the other? Any thoughts on how I might get around it without rewriting Shop-script completely?

Thanks in advance for any help.

Tony

dmorison

2:50 am on Aug 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Tony,

There shouldn't be any problem using $_GET and $_POST on the same URL - I have used it on several occasions. My advice would be to have look at your server logs. If you're using Apache, the default log settings show the HTTP request method (GET or POST) along with the page requested, so this should help you see where / how the gateway is submitting the form...

Habtom

4:41 am on Aug 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is either $_GET or $_POST, isn't it? And there is $_REQUEST in common.