Posted by Colin Fine on 10/01/06 17:27
mantrid wrote:
> Thanks Johnny
> That works but not if popups are blocked
> So I was wondering if there is a way of testing if popup blocking is set and
> if not run the first bit of code and if so run the second so at least the
> user would get the page even if it is not on a separate window ie something
> like;
>
>
> if(isset($_POST['viewtest'])){ ?>
>
> if popup blocking is not set then run the following
>
> <script type="text/javascript">
> window.open("http://www.mysite.co.uk/path/mypage.php");
> </script>
> <?php
>
> else if popup blocking is set run the following
>
> header("Location: http://www.mysite.co.uk/path/mypage.php");
>
> }
>
>
>
> "Johnny" <removethis.huuanito@hotmail.com> wrote in message
> news:OKmSg.406$UJ2.198@fed1read07...
>> "mantrid" <ian.dandav@virgin.net> wrote in message
>> news:DhiSg.42230$wo3.37618@newsfe7-gui.ntli.net...
>>> In some of my script ive been using the followin
>>>
>>> if(isset($_POST['mybutton'])){
>>> header("Location: http://www.mysite.co.uk/path/my.php");
>>> }
>>>
>>>
>>> This changes the page in the open browser window. How can I modify this
> to
>>> open a new window without replacing the parent
>>>
>>>
>> this works:
>>
>> if(isset($_POST['mybutton'])){
>> echo <<<WIND
>> <script type="text/javascript">
>> window.open("http://www.mysite.co.uk/path/my.php");
>> </script>
>> WIND;
>> }
>>
>> but as you can se also requires js
>>
>>
>
>
If there is a way, it is probably browser-dependent; and I'm not sure
there is.
But I would think that you could make the javascript try and create the
window with a name, and then check whether the named window exists. If
not, you can change 'location' in the Js.
Colin
[Back to original message]
|