Hi..

i have a login page and it is separately in my index.php

now i need my login page become a pop up form when I open my index.php

here is my login.php
Code:
<?php
  include 'config.php';
  
  session_start();
  
  //if (isset($_SESSION['logged_in'])) {
   //  header('Location:index.php');
  //   die();
 // }
  
  if (isset($_POST['submit'])) {
    $username=$_POST['username']; 
    $password=($_POST['password']);
    
     $sql = "SELECT username, password FROM pay_login WHERE username='$username' AND password='$password'";
     $rs = $conn2->Execute($sql);
     
     if($rs==1){  
        $_SESSION['logged_in'] = true;
        header("location:index.php");
    }
    else {
    echo "<center>";
    echo "Wrong Username or Password";
    echo "</center>";
    }
  }

$smarty->display('login.tpl');
  
?>
and here is my index.php
Code:
<?php
 session_regenerate_id(true);
/*include 'config.php';

if (!isset($_SESSION['empID'])) {
$sql = "SELECT EMP_ID FROM PERSONAL";
$recPersonal = $conn->Execute($sql);

if (!$recPersonal->BOF) {
    $recPersonal->MoveFirst();
}
session_register('empID');
$_SESSION['empID'] = $recPersonal->fields['EMP_ID'];
}   */
include 'config.php';
$currentEmpID = $_SESSION['empID']; 

if (!isset($_SESSION['empID'])) {
$sql = "SELECT EMP_ID, CONCAT(LNAME, ', ' , FNAME, ' ', MI) AS FULLNAME FROM PERSONAL ORDER BY LNAME ASC";
$recPersonal = $conn->Execute($sql);

session_register('empID');
$_SESSION['empID'] = $recPersonal->fields['EMP_ID'];
}

$sql = "SELECT EMP_ID, CONCAT(LNAME, ', ' , FNAME, ' ', MI) AS FULLNAME FROM PERSONAL ORDER BY LNAME ASC";



$recPersonalNav = $conn->GetAll($sql);


$smarty->assign('personalAll', $recPersonalNav);
// ========================================================================================================================

$sql = "SELECT EMP_ID, CONCAT(LNAME, ', ',  FNAME, ' ', MI, '.') AS FULLNAME FROM PERSONAL 
         WHERE EMP_ID='$currentEmpID'";          
  
$recPersonalHead = $conn->Execute($sql);
$fullName = $recPersonalHead->fields["FULLNAME"];
$smarty->assign('empid', $currentEmpID);
$smarty->assign('fullname', $fullName);

session_write_close();
 $smarty->display('header.tpl');
 $smarty->display('left.tpl');
$smarty->display('empPayroll.tpl');      
 $smarty->display('footer.tpl');
 exit(); 
?>
and I found a sample pop up code in internet but this pop needs a button befre it was displayed..I want is it will display when i run my index.php

here is the link of sample pop up form
http://www.nigraphic.com/blog/java-s...-center-screen

Thank you