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.

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

报告相同问题?

悬赏问题

  • ¥20 R语言单细胞测序 对seurat对象进行标准化时出现问题
  • ¥15 Anaconda navigator updateor一直更新
  • ¥15 请问如何在matlab里使用raven工具?
  • ¥100 关于ios手游充值到一定金额,再点充值提示公众号的问题。
  • ¥15 求一个stm32串口控制程序
  • ¥20 Windows 驱动开发版本疑问相关
  • ¥15 MAC 未能打开磁盘映像
  • ¥15 fastcap使用,二维导体输入问题
  • ¥15 hosts修改后不能访问
  • ¥15 关于化学反应速率C++编译问题/FLUENT