将 POST 变量传递给 PHP 可执行文件
我一直在用 C# 编写一个 HTTP 服务器,现在我想实现 PHP。但是,我似乎找不到将 POST 变量传递给 PHP-CGI 可执行文件的方法。我知道我应该使用环境变量与可执行文件进行通信,最重要的是 QUERY_STRING 变量。这个似乎只是将 GET 变量传递给 PHP,而不是 POST。我还尝试写入可执行文件的输入流,但它完全忽略了这一点。我缺少什么?
I have been writing an HTTP server in C#, and I've gotten to the point where I want to implement PHP. However, I cannot seem to find a way to pass POST variables to the PHP-CGI executable. I know that I am supposed to use environment variables to communicate with the executable, and most importantly the QUERY_STRING variable. This one just seems to pass GET variables to PHP, not POST. I've also tried writing to the input stream of the executable, but it just ignores that completely. What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要写入可执行文件的输入流。您是否确定设置了 CONTENT_LENGTH 环境变量?
You need to write to the input stream of the executable. Did you make sure to set the CONTENT_LENGTH environment variable?