Professional Web Applications Themes

Help to pop up a window before using Location to redirect a page - PHP Development

All I want to pop up a window before/during redirect to another page. Sort of a confirmation page: <? .... /* I need to pop up a window here */ header("Location:somecode here"); .... ?> Any comments are welcome. thx. -Steven...

  1. #1

    Default Help to pop up a window before using Location to redirect a page

    All

    I want to pop up a window before/during redirect to another page. Sort of a
    confirmation page:

    <?
    ....
    /*
    I need to pop up a window here
    */
    header("Location:somecode here");
    ....
    ?>

    Any comments are welcome. thx.

    -Steven


    Steven Guest

  2. #2

    Default Re: Help to pop up a window before using Location to redirect a page

    Steven wrote:
    > All
    >
    > I want to pop up a window before/during redirect to another page. Sort of a
    > confirmation page:
    >
    > <?
    > ...
    > /*
    > I need to pop up a window here
    > */
    > header("Location:somecode here");
    > ...
    > ?>
    >
    > Any comments are welcome. thx.
    >
    > -Steven
    >
    >
    It's impossible to do it the way you're talking about. headers have to
    be sent before any HTML, and what you're talking about would involve
    HTML, if not javascript. Only way I can think of to do what you want to
    do is javascript:

    // ... js code ...
    window.open('your_pr0n_popup',...); // ;-)
    window.location...
    //

    Joshua Ghiloni Guest

  3. #3

    Default Re: Help to pop up a window before using Location to redirect a page

    "Steven" <xuemingcomcast.net> wrote in
    news:L0DUa.153420$ye4.103857sccrnsc01:
    >
    > "Joshua Ghiloni" <jdg11SPAM.ME.AND.DIE.cwru.edu> wrote in message
    > news:bfutsl$5i3$1eeyore.INS.cwru.edu...
    >> Steven wrote:
    >> > "Joshua Ghiloni" <jdg11SPAM.ME.AND.DIE.cwru.edu> wrote in message
    >> > news:bfurdf$ts$1eeyore.INS.cwru.edu...
    >> >
    >> >>Steven wrote:
    >> >>
    >> >>>All
    >> >>>
    >> >>>I want to pop up a window before/during redirect to another page.
    >> >>>Sort
    >> >
    >> > of a
    >> >
    >> >>>confirmation page:
    >> >>>
    >> >>><?
    >> >>>...
    >> >>>/*
    >> >>> I need to pop up a window here
    >> >>>*/
    >> >>> header("Location:somecode here");
    >> >>>...
    >> >>>?>
    >> >>>
    >> >>>Any comments are welcome. thx.
    >> >>>
    >> >>>-Steven
    >> >>>
    >> >>>
    >> >>
    >> >>It's impossible to do it the way you're talking about. headers have
    >> >>to be sent before any HTML, and what you're talking about would
    >> >>involve HTML, if not javascript. Only way I can think of to do what
    >> >>you want to do is javascript:
    >> >>
    >> >>// ... js code ...
    >> >>window.open('your_pr0n_popup',...); // ;-)
    >> >>window.location...
    >> >>//
    >> >>
    >> >
    >> >
    >> > Thanks. Can I use js to popup new window and stll use header
    >> > location
    > for
    >> > theother?
    >> >
    >> > -Steven
    >> >
    >> >
    >> >
    >> >
    >>
    >> No. Javascript is just (kind of) a part of HTML. You can not send ANY
    >> output to the browser before sending headers, including the Location
    >> header. You can't even send blank lines. Read up on Javascript's
    >> window.location or window.href. Somethingl ike that.
    >>
    >
    > Thanks a lot for the quick response. Let me read some javascript now
    > :) ...
    >
    >
    >
    What about popping up the window after the redirect? On the page that
    loads after redirect add this to <body>:

    <body onLoad="window.open('yourpopupurl.html');">

    Or pass a querystring to test for popup:

    <body <? if ($_REQUEST["qstring"]=="Y") { echo " window.open
    ('yourpopup.html'); "; } ?>>

    HTH

    DB MCT

    D Benfer Guest

Similar Threads

  1. Location header - slow redirect
    By Admin in forum PHP Development
    Replies: 3
    Last Post: July 13th, 03:47 PM
  2. Create new window on Redirect?
    By bthouin in forum Dreamweaver AppDev
    Replies: 2
    Last Post: March 22nd, 12:07 AM
  3. window.location with target
    By ras in forum PHP Development
    Replies: 2
    Last Post: November 6th, 09:19 PM
  4. projector window location on PC?
    By prw webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 0
    Last Post: August 14th, 03:51 AM
  5. Replies: 1
    Last Post: July 1st, 03:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139