Problem with PHP HTTP_POST_VARS

To get started: I am a C ++ developer who is connected to creating a PHP script (for paypal IP address).

I was incredibly upset that he did not have good working samples from PayPal and elsewhere.

The final issue is that I don't seem to be getting any of the $ HTTP_POST_VARS elements that I think I should get.

Some Internet searches seem to indicate that it is either outdated or configurable, etc.

I do not know which version of PHP is used on my host.

It seems obvious that either my test applications are not published correctly, or the script is not working.

so: 2 questions: - Does anyone have links to working IPN scripts? - What gives nonsense with $ HTTP_POST_VARS?

EDIT

thank you all. I will try these suggestions and publish my success story, hopefully soon.

+4
source share
3 answers

You can check which version of PHP you are using by typing phpinfo(); into the <?php ?> PHP script block and see what it does (or just echo PHP_VERSION ).

$HTTP_POST_VARS is an old way of doing things. You can use $_POST['post-var'] . To view all published lines, use print_r($_POST) .

+3
source

The first thing to try is to change $ HTTP_POST_VARS to $ _POST. That the new mechanism, and after some version or $ HTTP_POST_VARS ceased to be superglobal.

+1
source

As chaos already wrote, just use the $_POST array instead of $HTTP_POST_VAR .
Two things I would like to mention:
1. var_dump(somevar) function is very useful in php. It displays structured information about somevar . If you don't know how a variable or array or something structured, just use this function. So this call var_dump($_POST); will display all current POST settings.
2. phpinfo() function is useful if you are interested in which version and extensions your host is using. Just create a file with <?php phpinfo(); ?> <?php phpinfo(); ?> in it and go to the browser to this file. Remember to remove it after that due to a security leak.

+1
source

All Articles