Jump to content

Pass variable to new window


dragance

Recommended Posts

I pass a variable to new window and it works for me in this way.

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<form name="calculator" action="http://www.domain.com/calc.php" target="_blank" method="post">
...
[/quote]

but I want to make that new window with fixed width & height.
Can I do this?
Thanks.


Link to comment
https://forums.phpfreaks.com/topic/9069-pass-variable-to-new-window/
Share on other sites

You can do what you want with a javascript

Here is and example

place this after your <html> and change what you want for the settings
[code]<script language="JavaScript">
popup_win = null;
function newwin() {
       popup_win = window.open('', 'popup_win', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, resizable=yes, copyhistory=no, scrollbars=no, width=500, height=500');
}
</script>[/code]

in your form tag use this but change the action setting to the page you want
[code]<form target=popup_win method="POST" action="mypage.php" onsubmit="newwin()">[/code]

Try it out

Ray

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.