This question already has an answer here:
I Want to open new window, And send to php file POST value.
Like
<a href = 'URL.php' target = '_blank'> Tish is link </a>
How to send POST value?
Edit : I already try this
<form target='_blank' method='POST' action='code.php'>
<input type = 'hidden' name='function_code' value='$code'>
<button id='submit_button' type = 'submit' value='$code'>$code</button>
</form>
But target=_blank opened new tab, not a pop-up(new window) I want to open 'New window & pop-up', Send Post value When i click button.
Solved like this
<form action='#' method='post' name='fdata' id='fdata'>
<input type='hidden' name='code' value='$code'>
<input type='button' name='btn' value='$code' onclick='window_open();'>
</form>
function window_open()
{
window.open("about:blank","window_name","width=640,height=480,scrollbars=yes");
document.fdata.target = "window_name";
document.fdata.method = "post";
document.fdata.action = "code.php";
document.fdata.submit();
}
Thank you so much!
</div>