-2
            <form method="post" target="_blank" action="battle.php" onsubmit="window.open('battle.php','','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=30,top=0');" >
                <input type="hidden" name="username" value="<?php echo $username; ?>"/>
                <input type="hidden" name="password" value="<?php echo $password; ?>"/>
                <input type="submit" value="OPEN TO BATTLE.php"/>
            </form>

^^Working but not the way I want it.

I am trying to make this form open a new window at the size 'width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=30,top=0'when the Submit button is clicked.

I want it so that the $_POST data is transfered through to the new webpage

Bamuel
  • 55
  • 8

2 Answers2

0
<form method="post" onsubmit="window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');" >
                <input type="hidden" name="username" value="<?php echo $username; ?>"/>
                <input type="hidden" name="password" value="<?php echo $password; ?>"/>
                <input onclick="" type="submit" value="OPEN TO BATTLE.php"/>
            </form>
Asheesh
  • 161
  • 3
  • 16
0

Try this:

<form method="post" action="battle.php" onsubmit='window.open("battle.php/?width=700&height=500&toolbar=0&menubar=0&location=0&status=0&scrollbars=0&resizable=0&left=30&top=0","_blank");' >
Dhara Parmar
  • 8,021
  • 1
  • 16
  • 27
  • That doesn't work properly http://localhost/battle.php/?width=700&height=500&toolbar=0&menubar=0&location=0&status=0&scrollbars=0&resizable=0&left=30&top=0 just opens a new tab with this in the url – Bamuel May 19 '16 at 21:39