PHP - open in new widow - Asked By Dan on 15-Feb-12 11:06 AM

I am try to open a HTTPS in a new window but I cannot seem to be able to do it. what am I doing wrong? I just wrote link inplace off real one.

https://link.html/new-window.php
D Company replied to Dan on 15-Feb-12 11:31 AM
Hello Dan,

You can do something like this,it should work.i dont know how you are doing , but i hope the any one of below approaches will surely work for you

window.open('https://some URL', '_blank' );

//and blank will allow to open in new window

or use location.href, if nothing works for you let me know the exact scenario , how are you doing the things


Hope its clear to you!!
Regards
D
[)ia6l0 iii replied to Dan on 15-Feb-12 11:31 AM
Use target=_blank in your href.
<a href="theurl" target="_blank">Click here to open in a new window</a>
Sreekumar P replied to Dan on 15-Feb-12 12:35 PM
Hi,

Try this code,

<INPUT type="button" value="New Window!" onClick="window.open('https://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')">
smr replied to Dan on 15-Feb-12 12:36 PM
hi

refer this example

How to open hyperlinks in a <a href="http://www.hyperlinkcode.com/new-window.php" target="_blank">New Browser Window</a> quickly 

The output will be:


How to open hyperlinks in a New Browser Window quickly. 
kalpana aparnathi replied to Dan on 15-Feb-12 02:16 PM
hi,

Try with this example:

<?php
    if(isset($_POST['submit'])) {
            if(isset($_POST['option'])) {
            $option = $_POST['option'];
            if($option == "yes") {
                //insert or update or do whatever you want with the posted values
                header("location: page3.php");//here you redirect to new window
            } else {
                header("location: page4.php");//here redirect to new window
            }
        } else {
            echo "You didn't select an option!";
        }
    }
?>