Jump to content

Recommended Posts

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 =)
Link to comment
https://forums.phpfreaks.com/topic/7148-redirecting-webpages-open-in-new-window/
Share on other sites

[!--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.





[!--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!
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.