PHP HTTP_POST_VARS 问题

发布于 2024-07-14 17:29:50 字数 371 浏览 4 评论 0原文

首先:我是一名 C++ 开发人员,致力于制作 PHP 脚本(用于 paypal IPN)。

我对贝宝和其他地方缺乏良好的工作样本感到非常沮丧。

最新的问题是我似乎没有得到任何我认为我应该得到的 $HTTP_POST_VARS 项目。

一些在线搜索似乎表明这已被弃用或可配置等。

我不知道我的主机使用什么版本的 PHP。

很明显,要么我的测试应用程序未正确发布,要么脚本无法正常工作。

所以:2个问题: - 有人有工作 IPN 脚本的链接吗? - $HTTP_POST_VARS 带来了什么废话?

编辑

谢谢大家。 我会尝试这些建议,并希望尽快发布我的成功故事。

To start: I am a C++ developer who is roped into making a PHP script (for paypal IPN).

I have been incredibly frustrated witht he lack of good working samples from paypal and elsewhere.

The latest problem is that I seem to not get any of the $HTTP_POST_VARS items that I think I should be getting.

Some searches online seem to indicate that this is either deprecated or configurable, etc.

I have no idea what version of PHP is used at my host.

It seems clear that either my testing applications do not post correctly or the script is not working.

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

EDIT

thanks all. I'll try these suggestions out and post up my success story soon I hope.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

红玫瑰 2024-07-21 17:29:50

您可以通过在 PHP 脚本块 中输入 phpinfo(); 来检查您使用的 PHP 版本,并查看它的输出(或者简单地)回声PHP_VERSION)。

$HTTP_POST_VARS 是旧的处理方式。 您可以使用$_POST['post-var']。 要检查发布的所有内容,请使用 print_r($_POST)

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

$HTTP_POST_VARS is the old way of doing things. You can use $_POST['post-var']. To examine everything beint posted, use print_r($_POST).

爱格式化 2024-07-21 17:29:50

首先要尝试的是将 $HTTP_POST_VARS 更改为 $_POST。 这是新机制,在某个版本或另一个版本之后 $HTTP_POST_VARS 不再是超全局的。

First thing to try is changing $HTTP_POST_VARS to $_POST. That's the new mechanism, and after some version or another $HTTP_POST_VARS stopped being a superglobal.

甜味超标? 2024-07-21 17:29:50

正如 Chaos 已经写的那样,只需使用 $_POST 数组而不是 $HTTP_POST_VAR 即可。
我想提两件事:
1. var_dump(somevar) 函数在php中非常有帮助。 它显示有关 somevar 的结构化信息。 如果您不确定某个变量或数组或其他内容的结构如何,只需使用此函数即可。 因此,此调用 var_dump($_POST); 将显示所有当前的 POST 参数。
2. phpinfo() function 很有帮助,如果您感兴趣的是您的主机使用哪个版本和扩展。 只需使用 并使用浏览器导航到该文件。 在此之后不要忘记将其删除,因为存在安全漏洞。

As chaos already wrote, just use the $_POST array instead of $HTTP_POST_VAR.
Two things i like to mention:
1. var_dump(somevar) function is very helpful in php. It displays structured information about somevar. If you not sure how is some variable or array or what ever is structured, just use this function. So this call var_dump($_POST); will display you all the current POST parameters.
2. phpinfo() function is helpful if you are interested which version and extensions is your host using. Just create a file with <?php phpinfo(); ?> in it and navigate with the browser to this file. Don't forget to remove it after this, because of the security leak.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文