Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Steven
Guest
 
Posts: n/a
#1: Jul 16 '05
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



Joshua Ghiloni
Guest
 
Posts: n/a
#2: Jul 16 '05

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


Steven wrote:[color=blue]
> 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
>
>[/color]

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

D Benfer
Guest
 
Posts: n/a
#3: Jul 16 '05

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

Gary Petersen
Guest
 
Posts: n/a
#4: Jul 16 '05

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


On Sat, 26 Jul 2003 15:50:05 -0500, Steven wrote:
[color=blue]
> I want to pop up a window before/during redirect to another page. Sort
> of a confirmation page:[/color]

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.

Closed Thread