By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,586 Members | 623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,586 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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...
//

Jul 16 '05 #2

P: n/a
"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

Jul 16 '05 #3

P: n/a
On Sat, 26 Jul 2003 15:50:05 -0500, Steven wrote:
I want to pop up a window before/during redirect to another page. Sort
of a confirmation page:


It's not possible. I would create an intermediary
page that would display the confirmation message
and refresh to the next page after a few seconds
or a minute.

Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.