session_start(); //include "include/unset.php"; include "include/connect.php"; $pass=""; if (isset($_POST['btnLogin'])) { $a1=$_POST['a1']; $a2=$_POST['a2']; if (!empty($a1)&& !empty($a2)){ $sql="SELECT * FROM iipengguna WHERE kp = '$a1' AND katalaluan='$a2'"; $result = mysql_query($sql,$ConnDB); while($row = mysql_fetch_array($result))//while1 { $sid = $row["kp"]; //$semel = $row["Email"]; $snama = $row["nama"]; $stahap_capaian= $row["tahap_capaian"]; $pass=1; } if ($pass==1){ //$xok="cun"; $_SESSION["kp"] = $sid; $_SESSION["nama"] = $snama; $_SESSION["tahap_capaian"] = $stahap_capaian; header("Location:Dashboard.php"); //echo $_SESSION["Email"]; //echo "ayam"; } else { $xok="Invalid Username or Password!"; } }else{ $xok="Please insert required field"; } } if (isset($_POST['Reset'])) { header("Location:index.php"); } ?>