This is the other code statement in php, the opposite of my other question, it's about time to finish updating the log after finishing the session login
<?php
include ('connect.php');/*to connect to database with oracle 11g*/
session_start();
$_SESSION = array();
$email = $_SESSION["EMAIL_USER"];
$passw = $_SESSION["PASS_USER"];
$query = "UPDATE LOGIN SET OUT_TIME_LOGIN = LOCALTIMESTAMP WHERE EMAIL_USER = '$email' AND PASS_USER = '$passw';";
$sid = oci_parse($conn, $query);
$result = oci_execute($sid);
$dbarray = oci_fetch_array($sid);
unset ($_SESSION);
if(ini_get("session.use_cookies")){
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 50000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]);
}
session_destroy();
session_commit();
/**/
header("location: ../menu.html");
?>
when I finish the logon session, was supposed to update the table with the login time to exit to exemples: LOCALTIMESTAMP where email_user = '$email';
and when I try log out, I received error
Undefined index: EMAIL_USER AND PASS_USER
and in my other question, PHP - Parse error: syntax error, unexpected end of file, I re-edited the codes and I made this
$query = "SELECT * FROM login WHERE user_email = '$email' AND user_pass= '$passw'";
$sid = oci_parse($conn, $query);
$result = oci_execute($sid);
$dbarray = oci_fetch_array($sid);
if (($dbarray["user_email"] == $email) && ($dbarray["user_pass"] == $passw)) {
session_start();
$_SESSION["user_email"] = $email;
$_SESSION["user_pass"] = $passw;
switch ($dbarray["type_user_id"]) {
case 1:
header("Location: admin.php");
break;
default:
echo "<script> alert('ERROR:'); history.back() </script>";
exit;
break;
}
}
and now I intend to do the opposite to get the email and password of the online session any suggestion?