Jump to content


Photo

redirecting webpages open in new window


  • Please log in to reply
2 replies to this topic

#1 sheepz

sheepz
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 11 April 2006 - 10:12 PM

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
<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>

here's the re-direction PHP page
<?

if ($_POST[locate]=="")
{
  header("Location: redirect_form.html");
  exit;
} else {
  header("Location: $_POST[locate]");
  exit;
}

?>

can i use window.open ? for this event? thx =)

#2 mystxx

mystxx
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 12 April 2006 - 01:10 AM

[!--quoteo(post=363818:date=Apr 11 2006, 05:12 PM:name=sheepz)--][div class=\'quotetop\']QUOTE(sheepz @ Apr 11 2006, 05:12 PM) View Post[/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
<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>

here's the re-direction PHP page
<?

if ($_POST[locate]=="")
{
  header("Location: redirect_form.html");
  exit;
} else {
  header("Location: $_POST[locate]");
  exit;
}

?>

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.







#3 sheepz

sheepz
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 12 April 2006 - 03:11 PM

[!--quoteo(post=363868:date=Apr 11 2006, 06:10 PM:name=Myst)--][div class=\'quotetop\']QUOTE(Myst @ Apr 11 2006, 06:10 PM) View Post[/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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users