How does URL rewriting affect the $_GET parameter for PHP?

URL重写如何影响PHP的$ _GET参数?

Say I have a URL like http://example.com/index.php?p=contact and I use $_GET['p'] to tell index.php to serve the contact page. If I use a rewrite rule that converts the URL to http://example.com/contact, will $_GET['p'] still work as expected?

假设我有一个像http://example.com/index.php?p=contact这样的网址,我使用$ _GET ['p']告诉index.php提供联系页面。如果我使用将URL转换为http://example.com/contact的重写规则,$ _GET ['p']仍然可以按预期工作吗?

If it does, could you elaborate on why it works? If not, what strategies could be used to solve the problem so that the page will work both with and without the rewrite?

如果确实如此,你能详细说明它的工作原理吗?如果没有,可以使用什么策略来解决问题,以便页面在重写和不重写时都能正常工作?

7 个解决方案

#1


Yes, that will work as expected.

是的,这将按预期工作。

更多相关文章

  1. 如何调试UPDATE函数在PHP中无法正常工作的原因?
  2. jquery ajax在调用之后将无法工作
  3. 当我将它移动到另一台服务器时,计数器将无法工作
  4. php会话不在chrome和firefox中工作但在IE中工作
  5. Php DateTime :: setDate()不在第一个DatePeriod迭代上工作
  6. Codeigniter在localhost中的url上没有index.php但在服务器中没有
  7. 使用where的Laravel集合只在本地工作,而不是在服务器上工作
  8. 数据库中的结果分页如何工作?
  9. 简单的插入语句不能在PHP代码中工作。适用于MySQL Workbench

随机推荐

  1. Flash 之ANE的applicationDeployment.nat
  2. 开发Android应用 提升性能的小技巧
  3. Android Button应用法则
  4. 使用Android Studio 创建第一个Android
  5. 如何在Android和iOS设备上录制游戏?
  6. Android命令Monkey压力测试,详解
  7. android全平台编译ffmpeg合并为单个库实
  8. 修改版本号
  9. 让Python程序在Android手机上跑起来
  10. android上各个浏览器的内核信息对比