<legend id='1Pdjo'><style id='1Pdjo'><dir id='1Pdjo'><q id='1Pdjo'></q></dir></style></legend>

      1. <tfoot id='1Pdjo'></tfoot>

        <small id='1Pdjo'></small><noframes id='1Pdjo'>

        • <bdo id='1Pdjo'></bdo><ul id='1Pdjo'></ul>
        <i id='1Pdjo'><tr id='1Pdjo'><dt id='1Pdjo'><q id='1Pdjo'><span id='1Pdjo'><b id='1Pdjo'><form id='1Pdjo'><ins id='1Pdjo'></ins><ul id='1Pdjo'></ul><sub id='1Pdjo'></sub></form><legend id='1Pdjo'></legend><bdo id='1Pdjo'><pre id='1Pdjo'><center id='1Pdjo'></center></pre></bdo></b><th id='1Pdjo'></th></span></q></dt></tr></i><div id='1Pdjo'><tfoot id='1Pdjo'></tfoot><dl id='1Pdjo'><fieldset id='1Pdjo'></fieldset></dl></div>
      2. 如何将 GET 和 POST 数据传递给 php 可执行文件?

        时间:2023-10-13
            <tfoot id='1QHPy'></tfoot>

              <bdo id='1QHPy'></bdo><ul id='1QHPy'></ul>
                <tbody id='1QHPy'></tbody>
              <i id='1QHPy'><tr id='1QHPy'><dt id='1QHPy'><q id='1QHPy'><span id='1QHPy'><b id='1QHPy'><form id='1QHPy'><ins id='1QHPy'></ins><ul id='1QHPy'></ul><sub id='1QHPy'></sub></form><legend id='1QHPy'></legend><bdo id='1QHPy'><pre id='1QHPy'><center id='1QHPy'></center></pre></bdo></b><th id='1QHPy'></th></span></q></dt></tr></i><div id='1QHPy'><tfoot id='1QHPy'></tfoot><dl id='1QHPy'><fieldset id='1QHPy'></fieldset></dl></div>
            • <legend id='1QHPy'><style id='1QHPy'><dir id='1QHPy'><q id='1QHPy'></q></dir></style></legend>

              <small id='1QHPy'></small><noframes id='1QHPy'>

                  本文介绍了如何将 GET 和 POST 数据传递给 php 可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在用 C# 编写一个 Web 服务器,并且我正在尝试添加对 PHP 的支持.我大部分时间都在工作,除了我不知道如何在将文件传递给 PHP 可执行文件时将 GET 和 POST 数据传递给它.我一直在使用 GET 进行测试,因为我还没有在服务器上处理 POST 请求,并且我将传递的参数字符串分开,但我不知道如何将信息提供给 php 解析器.一些提示将不胜感激.

                  I am writing a web server in C# and I'm trying to add support for PHP. I have it mostly working, except I don't know how to past GET and POST data to the PHP executable when i pass the file to it. I've been testing with GET since I haven't gotten to getting POST requests handled on the server, and I have the string of the arguments that gets passed separated, but I don't know how to feed the information to the php parser. Some tips would be appreciated.

                  推荐答案

                  对于 GET:简单的方法(我找到了):

                  For GET: The Easy Way (That i've found):

                  php-cgi.exe <script-file-name> <parameter1>=<value1> <parameter2>=<value2> [...] <parameterN>=<valueN>
                  

                  更难的方法(通过 php-cgi 和 windows cli)是:

                  The Harder Way (via php-cgi and windows cli) would be:

                  SET "QUERY_STRING=<parameter1>=<value1>&<parameter2>=<value2>&[...]&<paramterN>=<valueN>"
                  SET SCRIPT_NAME=<script-file-name>
                  SET REQUEST_METHOD=GET
                  SET REDIRECT_STATUS=0
                  php-cgi.exe
                  

                  我假设有一种方法可以通过 C#/.Net 设置环境变量.php-cgi.exe 完成后,必须取消设置环境变量.

                  I'd assume there would be a way to set environment variable via C#/.Net. The environment variables would have to be unset after php-cgi.exe completes.

                  有关您可以在 http://上设置的 CGI 环境变量(以及一般的 CGI)的更多信息www.ietf.org/rfc/rfc3875.txt.PHP 的 $_SERVER 变量文档也可能有用.php.net 上的 PHP 文档中也有将 PHP 作为 CGI 运行的安全注意事项.

                  More info for CGI environment variables you could set (and CGI in general) at http://www.ietf.org/rfc/rfc3875.txt. Might also be of use would be PHP's $_SERVER variable documentation. Security considerations for running PHP as CGI also in PHP documentation at php.net.

                  这篇关于如何将 GET 和 POST 数据传递给 php 可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:对于登录 GET 还是 POST? 下一篇:Curl : * 违反 RFC 2616/10.3.2 并从 POST 切换到 GET

                  相关文章

                  <i id='6l21M'><tr id='6l21M'><dt id='6l21M'><q id='6l21M'><span id='6l21M'><b id='6l21M'><form id='6l21M'><ins id='6l21M'></ins><ul id='6l21M'></ul><sub id='6l21M'></sub></form><legend id='6l21M'></legend><bdo id='6l21M'><pre id='6l21M'><center id='6l21M'></center></pre></bdo></b><th id='6l21M'></th></span></q></dt></tr></i><div id='6l21M'><tfoot id='6l21M'></tfoot><dl id='6l21M'><fieldset id='6l21M'></fieldset></dl></div>
                1. <small id='6l21M'></small><noframes id='6l21M'>

                  <tfoot id='6l21M'></tfoot>

                    <bdo id='6l21M'></bdo><ul id='6l21M'></ul>
                  <legend id='6l21M'><style id='6l21M'><dir id='6l21M'><q id='6l21M'></q></dir></style></legend>