$url = 'test'; echo '<form action="'.$url.'" id="form" target="_blank"></form>';
button.onclick = function() { document.getElementById('form').submit() }