doujiaozhan2413 2013-12-21 18:41
浏览 42
已采纳

带有AJAX加载页面的PHP标头?

I currently have it set up so that to navigate to various pages you click links on index.php, which then load into the content box of index.php.

I currently have a form on one of those pages that once submitted, I would like to redirect to the index.php page. But instead of displaying the default content on index.php, I'd like to specify the page loaded into the content box.

Is there a way to do this using a header? eg. header('Location: index.php#<contentboxpagehere>'); ??

Thanks!

  • 写回答

1条回答 默认 最新

  • doumengbai2031 2013-12-21 18:58
    关注

    So if I have understood correctly, you have a form and after a successful submission you want to redirect to the front page and display the right output message with an AJAX call in your defined page container.

    You can achieve that in many ways. Keeping it simple and PHP you can do that with either a POST or GET request on the index page passing the container id you want to call in your front page AJAX container.

    Using GET, pass URL parameter like: index.php?cbpId=success

    Get the $_GET['cbpId'] and load the right content on the front page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥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#的问题,如何解决?