简体   繁体   中英

How can I stay on same page and open a new tab automatically

<?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

function formAutoSubmit () {
            var frm = document.getElementById("myform");
            frm.submit();
            window.open("http://google.com"); // Or pass any other URL
            }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM