sheepz Posted April 11, 2006 Share Posted April 11, 2006 hi i have a simple site that has a drop down list of sites. this form points to a re-direction.php page. how do i make it where when it re-directs it will open in a brand new browser window? here's the html [code]<FORM METHOD="post" ACTION="do_redirect.php"> Popular downloads <select name="locate"> <option value="http://www.macromedia.com/shockwave/download/triggerpages_mmcom/flash.html/"> Macromedia FlashPlayer </option> <option value="http://www.apple.com/quicktime/download/win.html/"> QuickTime </option> <option value="http://adobe.com/support/downloads/"> Adobe downloads </option> <INPUT TYPE="submit" NAME="submit" Value="Go"></p> </form>[/code]here's the re-direction PHP page[code]<?if ($_POST[locate]==""){ header("Location: redirect_form.html"); exit;} else { header("Location: $_POST[locate]"); exit;}?>[/code]can i use window.open ? for this event? thx =) Quote Link to comment https://forums.phpfreaks.com/topic/7148-redirecting-webpages-open-in-new-window/ Share on other sites More sharing options...
mystxx Posted April 12, 2006 Share Posted April 12, 2006 [!--quoteo(post=363818:date=Apr 11 2006, 05:12 PM:name=sheepz)--][div class=\'quotetop\']QUOTE(sheepz @ Apr 11 2006, 05:12 PM) [snapback]363818[/snapback][/div][div class=\'quotemain\'][!--quotec--]hi i have a simple site that has a drop down list of sites. this form points to a re-direction.php page. how do i make it where when it re-directs it will open in a brand new browser window? here's the html [code]<FORM METHOD="post" ACTION="do_redirect.php"> Popular downloads <select name="locate"> <option value="http://www.macromedia.com/shockwave/download/triggerpages_mmcom/flash.html/"> Macromedia FlashPlayer </option> <option value="http://www.apple.com/quicktime/download/win.html/"> QuickTime </option> <option value="http://adobe.com/support/downloads/"> Adobe downloads </option> <INPUT TYPE="submit" NAME="submit" Value="Go"></p> </form>[/code]here's the re-direction PHP page[code]<?if ($_POST[locate]==""){ header("Location: redirect_form.html"); exit;} else { header("Location: $_POST[locate]"); exit;}?>[/code]can i use window.open ? for this event? thx =)[/quote]Hi.Probably a <FORM target="_blank" .... would do the trick. Or make a js function, that will be called onSubmit. It will check wich option in the dropdown is checked then pass it to window.open. Quote Link to comment https://forums.phpfreaks.com/topic/7148-redirecting-webpages-open-in-new-window/#findComment-26056 Share on other sites More sharing options...
sheepz Posted April 12, 2006 Author Share Posted April 12, 2006 [!--quoteo(post=363868:date=Apr 11 2006, 06:10 PM:name=Myst)--][div class=\'quotetop\']QUOTE(Myst @ Apr 11 2006, 06:10 PM) [snapback]363868[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi.Probably a <FORM target="_blank" .... would do the trick. Or make a js function, that will be called onSubmit. It will check wich option in the dropdown is checked then pass it to window.open.[/quote]i haven't any experience with js yet... i hope to be learning that soon... but your suggestion works great the _blank. works exactly how i want it to function! cheers! Quote Link to comment https://forums.phpfreaks.com/topic/7148-redirecting-webpages-open-in-new-window/#findComment-26245 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.