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

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

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

      使用 htaccess 重写/重定向,以便单个 PHP 文件可以根据 GET/POST 变量显示数据

      Using htaccess rewrite/redirect so single PHP file can display data according to GET/POST variables(使用 htaccess 重写/重定向,以便单个 PHP 文件可以根据 GET/POST 变量显示数据)
      <i id='Yme9E'><tr id='Yme9E'><dt id='Yme9E'><q id='Yme9E'><span id='Yme9E'><b id='Yme9E'><form id='Yme9E'><ins id='Yme9E'></ins><ul id='Yme9E'></ul><sub id='Yme9E'></sub></form><legend id='Yme9E'></legend><bdo id='Yme9E'><pre id='Yme9E'><center id='Yme9E'></center></pre></bdo></b><th id='Yme9E'></th></span></q></dt></tr></i><div id='Yme9E'><tfoot id='Yme9E'></tfoot><dl id='Yme9E'><fieldset id='Yme9E'></fieldset></dl></div>
          • <bdo id='Yme9E'></bdo><ul id='Yme9E'></ul>
            1. <small id='Yme9E'></small><noframes id='Yme9E'>

              <tfoot id='Yme9E'></tfoot>

                <tbody id='Yme9E'></tbody>

                <legend id='Yme9E'><style id='Yme9E'><dir id='Yme9E'><q id='Yme9E'></q></dir></style></legend>

              • 本文介绍了使用 htaccess 重写/重定向,以便单个 PHP 文件可以根据 GET/POST 变量显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                请耐心等待我尝试了解有关 .htaccess 重定向规则的更多信息 - 我的职业是 UI 专家,我正在尽最大努力提高我的编码技能,而不是 HTML/CSS/PHP 等语言

                Bear with me as I try to learn more about .htaccess redirect rules - I'm a UI guy by profession and I'm doing my best to enhance my coding skills languages other than HTML/CSS/PHP, etc

                所以,我拥有的是一个包含菜单的 index.php 文件 - 非常简单.如果在用户计算机上启用了 Javascript,则使用简单的 jQuery 好东西在菜单下方显示表单,每个链接都有一个返回假;"已申请.

                So, what I have is an index.php file that contains a menu - pretty simple. If Javascript is enabled on the users computer then forms are shown below the menu using simple jQuery goodies, with each link having a 'return false;' applied.

                我想要做的是在关闭 JS 的情况下使页面可访问,因此我不想将用户重定向到不同的页面,而是想使用每个链接中的 POST 或 GET 变量来显示各种表单.在同一个 index.php 文件中 - 但让 URL 反映菜单选择

                What I am trying to do is make the page accessible with JS turned off, so instead of redirecting the user to a different page, I would like to use POST or GET variables from each link, to show the various forms.. within the same index.php file - but have the URL reflect the menu choice

                以下是使用名为 - Home、About、Form1 和 Form2 的菜单项的示例:

                Here is an example using menu items named - Home, About, Form1 and Form2:

                启用 JS 后,单击上面的示例按钮只需将表单或包含数据的内容向下滑动到页面上.

                With JS on, clicking on of the above example buttons simply slides the form or containing the data down onto the page.

                关闭 JS,如果用户单击关于"链接,我想将 URL 重写为 http://domain.com/about - 但将用户保留在 index.php 页面上(因为它是唯一的页面)并且能够使用 POST 或 GET 变量来显示正在使用的 PHP.

                With JS off, if the user clicks the 'About' link, I would like to rewrite the URL to be http://domain.com/about - but keep the user on the index.php page (since it is the only page) and be able to use POST or GET variable to show the using PHP.

                因此,访问 http://domain.com/index.php?page=about会显示http://domain.com/about 在 URL 中,但将 GET 变量 'page' 传递给 index.php文件.

                So, accessing http://domain.com/index.php?page=about would show http://domain.com/about in the URL but pass the GET variable 'page' to the index.php file.

                希望这是有道理的..我相信有很多方法可以做到这一点,所以如果你有关于如何改进它的想法,无论如何,我很乐意听到它!

                Hope that makes sense.. and I'm sure there are many ways to accomplish this, so if you have ideas of how to improve on it, by all means, I'd love to hear it !

                再次感谢复活

                推荐答案

                mod_rewrite:

                RewriteEngine on
                RewriteBase /
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(.+)$ /index.php?page=$1 [L]
                

                这篇关于使用 htaccess 重写/重定向,以便单个 PHP 文件可以根据 GET/POST 变量显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 的问题)

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

                      <tfoot id='4747F'></tfoot>

                      <small id='4747F'></small><noframes id='4747F'>

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