views:

38

answers:

2

Update:

As seen in the Original Questions below, I am looking to echo an array. The problem is that when I send the Moneris gateway to return a POST array to my new file (cart.php) it gets a 500 Internal Server Error.

This is the same error I received when it send to the script, which should have worked. Is there any reason that it would always send a 500 Internal Server Error?

Cart.php Direct Link

Craig


ORIGINAL QUESTION:

Hello there,

I am back for another question.

Here is my dilemma:

I have a script (ImageFolio Commerce) that hasn't been updated on our server since.. probably 2003. The script had a Payment Gateway (Moneris) manually added to it by the company who offers the script. This costs $1000 to get them to add a gateway.

I now have a new client who purchased this business from the previous owner. While switching the account to the new owner's Moneris account, we found out that things have been updated.

Long story short..

The Moneris gateway can send 3 types of responses:

  1. POST with XML Data
  2. POST
  3. GET

I imagine it is easiest to just use the POST array. I have the file that it sends the response to. As of now the file responds with a Internal Server error, but it does process the order.

What I want to do is determine what the POST array is that is being sent, so that I can take it and echo it in a logical manner. Is there a way to capture and echo the entire POST?

Or can someone suggest a better method of doing this?

Thank you,

Craig

+2  A: 

either

var_dump($_POST);

or

echo "<pre>";
print_r($_POST);
echo "</pre>";

Both will output array in a readable format for you to analyse

Lizard
Thank you very much. Trying this now. Ends up the files are all CGI and I completely missed that, so I'm going to send it through an external PHP file. (Don't know much about CGI at all)
gamerzfuse
I updated the question to a new question of sorts. It just doesn't work. Could it be that it's an https:// referencing an http:// page?
gamerzfuse
+1  A: 

Instead of viewing the POSTed contents server side (as shown in Lizard's answer), you can also do so client-side...

The HTTP headers your client is sending can be viewed with tools such as Firebug for Firefox and Chrome.

Dolph
This sounds like it might work then. I have firebug, so I might just try looking into that.
gamerzfuse
Ok, so I can see exactly what is sent now (thanks for the easier method). However, I am still getting a 500 Internal Server Issue whenever I send data to the script from Moneris. Doesn't matter what I do, but it sends the transaction and then displays an error?
gamerzfuse
I think your 500 error is outside the scope of this question, but you should be able to access Apache/PHP's error logs on the server, which will give you more insight as to the cause of your 500 error.
Dolph