"Steven" <xu*****@comcast.net> wrote in
news:L0DUa.153420$ye4.103857@sccrnsc01:
"Joshua Ghiloni" <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message
news:bf**********@eeyore.INS.cwru.edu... Steven wrote: > "Joshua Ghiloni" <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message
> news:bf*********@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 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