jquery - Open Window.open() With POST Data and get data with PHP -
i have form username , password. when click on submit buttom username , password pass page , open new window.
i know pass data request like
window.open('url.php?unm=username&pass=password','_blank');
but in case don't want display data in url. want use post method data in url.php page.
so how this. please help.. advance
below code use :
$.post("url.php?unm=username&pass=password",function(data){ $("#form").hide(); });
you need form submit , open new window
<form id="form" method="post" action="url.php" target="thewindow"> <input type="hidden" name="unm" value="" /> <input type="hidden" name="pass" value="" /> </form> <script> function post(name,password) { var f = document.getelementbyid('form'); f.unm.value = name; f.pass.value = password; window.open('', 'thewindow'); f.submit(); } post("username","password"); </script>
Comments
Post a Comment