doujugu1722 2012-06-07 13:49
浏览 71
已采纳

Wordpress中的PHP $ _SERVER ['PHP_SELF']重定向到索引页面

I have a wordpress website. There is a category page with a form on it to sort / filter the posts.

I have tried using $_SERVER['PHP_SELF'] as the form action as i need to get the contents of the form to display the posts but when I do it redirects to the index page.

Is there a reason for this? Or a better way to submit a form within wordpress.

Thanks

  • 写回答

4条回答 默认 最新

  • doucang9673 2012-06-07 13:53
    关注

    The reason for this is that Wordpress runs (almost) everything through the index.php page and then handles which page to display via it's routing logic. You might try doing var_dump($_SERVER); to see which value you want but it's probably $_SERVER['REQUEST_URI'].

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?