PHP once form valued saved show popupwindow
<p>I am new to PHP.</p>

<p>My requirement is once the form value save into mysql database, it need to show the entered value into popup window. </p>

<p>I did this part .Problem is always open new tab &amp; show detail. It didn't open opoup window.</p>

<pre><code>    &lt;?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
//echo '&lt;pre&gt;';
//echo print_r($_POST);
//echo '&lt;/pre&gt;';

$message = "";
$firstname ="";
$lastname = "";
$email = "";
$mobile = "";
$nic = "";
$msg ="";
$genrateID = "";

if ( isset ( $_POST['Submit'] ) ){
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $mobile = $_POST['mobile'];
    $nic = $_POST['nic'];

    if($firstname ==''){
        $message .= "Enter firstname";
    }else if($lastname ==''){
        $message .= "Enter lastname";
    }else if($email==''){
        $message = "Enter email address";
    }else if(!is_valid_email($email)){
        $message .= "Enter valid email address";
    }else if($mobile==''){
        $message = "Enter email address";
    }else if(!is_valid_phone($email)){
        $message .= "Enter valid email address";
    }else if($nic==''){
        $message = "Enter nic number";
    }else if(!is_valid_nic($nic)){
        $message .= "Enter valid nic address";

    }else{
        if(empty($message)){
             $con = mysql_connect("192.168.1.5","root","root");
             if (!$con){
                die('Could not connect: ' . mysql_error());
                exit;
             }
             mysql_select_db("customerinfo", $con);
             $genrateID =uniqid (rand(), true);
             // mysql_query("INSERT INTO customerinfo (firstname ,lastname,email,mobile,nic) VALUES ('$firstname', '$lastname','$email','$mobile','$nic')" ) or die(mysql_error());
             $status = mysql_query("INSERT INTO customer (firstname ,lastname,email,mobile,nic,customerID)
             VALUES ('$firstname', '$lastname','$email','$mobile','$nic','$genrateID')");
            if($status =='1'){
                $msg ="Data has been saved successfully";


 $link = "&lt;script&gt;window.open('http://localhost/UserCRM/result.php?firstname=$firstname&amp;lastname=$lastname&amp;mobile=$mobile&amp;email=$email&amp;id=$genrateID','menubar=no,width=430,height=360,toolbar=no')&lt;/script&gt;";
                echo $link;
                $message = "";
                $firstname ="";
                $lastname = "";
                $email = "";
                $mobile = "";
                $nic = "";
                $genrateID ="";
               // $msg ="";

            }else{
                $msg = "Data has been saved unsuccessfully!!";
            }
            mysql_close($con);
        }

    }
}


?&gt; 
</code></pre>

<p>My form is : </p>

<pre><code>  &lt;form id="form" method="post" action="index.php" style="width:700px;" &gt;..... &lt;/form&gt;
</code></pre>

<p>Please indicate me what is wrong in my code.</p>

<p>Thanks in advance.</p>
