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

          <bdo id='NPNAm'></bdo><ul id='NPNAm'></ul>

        PHP include() 带有 GET 属性(包含 file.php?q=1)

        PHP include() with GET attributes (include file.php?q=1)(PHP include() 带有 GET 属性(包含 file.php?q=1))

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

              <legend id='V09gD'><style id='V09gD'><dir id='V09gD'><q id='V09gD'></q></dir></style></legend>
              • <bdo id='V09gD'></bdo><ul id='V09gD'></ul>

                  <tfoot id='V09gD'></tfoot>

                  <small id='V09gD'></small><noframes id='V09gD'>

                  本文介绍了PHP include() 带有 GET 属性(包含 file.php?q=1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想include() 一个位于我的服务器上的 php 文件,带有额外的 GET 属性.但它不起作用:

                  I want to include() a php file located on my server, with additional GET attributes. But it won't work:

                  include('search.php?q=1');
                  

                  它给出的错误:

                  PHP Warning:  include(): Failed opening './search.php?q=1' for inclusion
                  

                  似乎它试图打开一个字面名为search.php?q=1"的文件,而不是打开search.php"文件并向其发送 GET 属性.

                  Seems like it tries to open a file literally named 'search.php?q=1' instead of opening the 'search.php' file and sending it the GET attributes.

                  *请注意,如果我不放置任何 GET 属性,它确实有效:

                  *Note that it does work if I don't put any GET attributes:

                  include('search.php');
                  

                  推荐答案

                  您不想这样做:您必须执行 http 请求才能传递 GET 参数.您以这种方式调用的 PHP 脚本将在单独的 PHP 进程中运行.

                  You don't want to do this: You'd have to do a http request to be able to pass GET parameters. A PHP script you call in this way will run in a separate PHP process.

                  最佳方式是在本地包含文件:

                  The optimal way is to include the file locally:

                  include('search.php');
                  

                  并手动将任何参数传递给它,例如

                  and to pass any parameters to it manually, like e.g.

                  $q = "1";
                  include('search.php');  // expects `$q` parameter
                  

                  或者,更简洁地,将 search.php 中的任何内容放入可以使用参数调用的函数或类中:

                  or, more cleanly, putting whatever you have in search.php into a function or class that you can call with a parameter:

                  include('search.php');  // defines function my_search($q)  
                  my_search(1);       
                  

                  这篇关于PHP include() 带有 GET 属性(包含 file.php?q=1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <legend id='FSlwx'><style id='FSlwx'><dir id='FSlwx'><q id='FSlwx'></q></dir></style></legend>
                  1. <tfoot id='FSlwx'></tfoot>

                        <tbody id='FSlwx'></tbody>

                          <bdo id='FSlwx'></bdo><ul id='FSlwx'></ul>

                          <small id='FSlwx'></small><noframes id='FSlwx'>

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