Jump to content

Redirecting to a new Window.


pthurmond

Recommended Posts

you'd want to use javascript

[code]
<?
function popup($text, $link, $name="myWindow", $height="300", $width="300", $resizable="0", $status="0", $class=""){
return '<a href="#" onclick=\'javascript: window.open("'.$link.'", "'.$name.'", "status='.$status.', height='.$height.', width='.$width.', resizable='.$resizable.'")\' class='.$class.'>'.$text.'</a>';
}
?>
[/code]
The problem is I have a script that has to store some data in the session data first and then redirects to a page that uses that data. The problem is I want the first page to open in the same window, but the redirected to page to open in another window. So I need it to automatically redirect to the page in a new window once it successfully processes the data.

Any ideas.

Thanks,
Patrick
you can have the javascript in the body for onLoad = 'javascript:whateverfunction()'

when you have your original page redirect, have the if($_POST['submit']){ around the javascript function that way it will only fire if the redirect was from the origianl submit.  You can also add in error handling.
if you use the body onload="" to pop up a new window, most popup stoppers will stop your popup!  You should try to find a way to do it all in one window, keeping the current window and popping up a new window will fail in most cases because of popup stoppers.

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.