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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?