dongsuo0517 2011-09-14 14:51
浏览 23
已采纳

打开包含帖子数据的新页面

In PHP, i want to open more that one window and each one of them need to recieve different post data.

i know how to redirect a page via header location + Get DATA, but i really need to be able to send POST data.

EDIT:

Graph
       |-Page with post 1
Main --|-Page with post 2
       |-Page with post 3

so basically 1 page goes and open 3 pages with different post data on each. must be done server Side.

  • 写回答

5条回答 默认 最新

  • dsms21398 2011-09-14 19:15
    关注

    why not use three forms? ;-) Code tested, works.

    <form method='post' action='http://<sever>/post1.php' id='action_frm1' name="action_frm1" target="_blank">
      <input type='hidden' name='param1' value='hello'/>
      <input type='hidden' name='param2' value='world'/>
    </form>
    <form method='post' action='http://<sever>/post2.php' id='action_frm2'  name="action_frm2" target="_blank">
      <input type='hidden' name='param1' value='hello2'/>
      <input type='hidden' name='param2' value='world2'/>
    </form>
    <form method='post' action='http://<sever>/post3.php' id='action_frm3'  name="action_frm3" target="_blank">
      <input type='hidden' name='param1' value='hello3'/>
      <input type='hidden' name='param2' value='world3'/>
    </form>
    <script type='text/javascript'>
         function makePostRedirect() {
           document.getElementById('action_frm1').submit();
           document.getElementById('action_frm2').submit();
           document.getElementById('action_frm3').submit();
         }
         makePostRedirect()
    </script>
    

    Of course, if you want post data via serverside usefull link will be this: http://noobflash.com/server-side-post-with-php/

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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效