douaoli5328
2015-02-16 18:59
浏览 96
已采纳

如何保持同一页面并自动打开新标签页

<?php 

error_reporting(E_ALL);
$name=$_GET['name'];
$email=$_GET['email'];
$key=$_GET['key'];

 ?>
<!DOCTYPE HTML>

<html>
    <head>
        <title></title>
        <link rel="shortcut icon" href="favicon/favicon.ico" type="image/x-icon">
        <link rel="icon" href="favicon/favicon.ico" type="image/x-icon">
        <script type="text/javascript">
            function formAutoSubmit () {
            var frm = document.getElementById("myform");
            frm.submit();
            }
            window.onload = formAutoSubmit;
            </script>
    </head>

<body>





 <form method='POST' id="myform" action='https://www.example.com/cgi-bin/arp3/arp3-formcapture.pl'>

                        <input type='hidden' type='text' name='first_name' value='<?php echo $name ?>' size='20'>

                        <input type='hidden' type='text' name='email' value='<?php echo $email; ?>' size='20'>

                        <input type='hidden' name='subscription_type' value='E'><div align='center'><center>

                        <input type='hidden' name='id' value='3'>

                        <input type='hidden' name='extra_ar' value=''>

                    <input type='hidden' type='submit' value='Please click here to complete signup process' >
                    </form>

    <?php include 'login/js/main_js.php'; ?>
</body>

I am trying to submit a form automatically and also want to automatically open a new tab or window from this same page with given url. What I am trying to do is when this page open a form is submitted to auto res ponder and also open a new page to activate user account please help

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanfengwang9157 2015-02-16 19:05
    已采纳
    function formAutoSubmit () {
                var frm = document.getElementById("myform");
                frm.submit();
                window.open("http://google.com"); // Or pass any other URL
                }
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题