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 三极管电路求解,已知电阻电压和三级关放大倍数
  • ¥15 ADS时域 连续相位观察方法
  • ¥15 Opencv配置出错
  • ¥15 模电中二极管,三极管和电容的应用
  • ¥15 关于模型导入UNITY的.FBX: Check external application preferences.警告。
  • ¥15 气象网格数据与卫星轨道数据如何匹配
  • ¥100 java ee ssm项目 悬赏,感兴趣直接联系我
  • ¥15 微软账户问题不小心注销了好像
  • ¥15 x264库中预测模式字IPM、运动向量差MVD、量化后的DCT系数的位置
  • ¥15 curl 命令调用正常,程序调用报 java.net.ConnectException: connection refused