<?
$user_login=$_POST[user];
$pass_login=$_POST[password];
if($user_login=="" or $pass_login=="") {
exit();
}
include "connect.php";
$query = "SELECT * from tb_admin where ADMIN_LOGIN ='$user_login' and ADMIN_PASSWORD='$pass_login'";
$statement = oci_parse ($connection, $query);
$row=oci_execute ($statement);
if($num<=0) {
echo"รหัสไม่ถูกต้อง";
} else {
session_start();
$_SESSION[sess_userid]=session_id();
$_SESSION[sess_username]=$user_login;
header("Location:menu.php");
}
?>
ทำได้แล้วครับ
<?
$user_login=$_POST["uname"];
$pass_login=$_POST["pname"];
include "config_oracle.php";
$stmt = oci_parse($conn, "SELECT * from tb_admin where ADMIN_LOGIN ='$user_login' and ADMIN_PASSWORD='$pass_login'");
oci_execute($stmt);
$nrows = oci_fetch_all($stmt, $results);
if ($nrows > 0) {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=admin_menu.php\">";
} else {
include "java.php";
}
?>
จะต้อง config ตัว php.ini รึปล่าวครับ