| re: Help to pop up a window before using Location to redirect a page
"Steven" <xueming@comcast.net> wrote in
news:L0DUa.153420$ye4.103857@sccrnsc01:
[color=blue]
>
> "Joshua Ghiloni" <jdg11@SPAM.ME.AND.DIE.cwru.edu> wrote in message
> news:bfutsl$5i3$1@eeyore.INS.cwru.edu...[color=green]
>> Steven wrote:[color=darkred]
>> > "Joshua Ghiloni" <jdg11@SPAM.ME.AND.DIE.cwru.edu> wrote in message
>> > news:bfurdf$ts$1@eeyore.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[/color][/color]
> for[color=green][color=darkred]
>> > theother?
>> >
>> > -Steven
>> >
>> >
>> >
>> >[/color]
>>
>> 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.
>>[/color]
>
> Thanks a lot for the quick response. Let me read some javascript now
> :) ...
>
>
>[/color]
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 |