PHP Classes

File: app/controls/logout.php

Recommend this page to a friend!
  Classes of Laudir Bispo   PHP Real Estate Website   app/controls/logout.php   Download  
File: app/controls/logout.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Real Estate Website
Manage the properties of a real estate business
Author: By
Last change:
Date: 3 years ago
Size: 598 bytes
 

Contents

Class file image Download
?<?php
require_once ($_SERVER['DOCUMENT_ROOT'].'/config/config.php');
require_once (
$_SERVER['DOCUMENT_ROOT'].'/config/autoload.php');
session_name(SESSION_NAME);
session_start();

$con_db = new config\connect_db();
$con = $con_db->connect();

$sts = '3';

$update_status = $con->prepare("INSERT INTO online_users (user_id, status) VALUES (?, ?) ON DUPLICATE KEY UPDATE status = '3' ");
$update_status->bind_param('ii', $_SESSION['user_id'], $sts);
$update_status->execute();
$update_status->close();

$_SESSION = array();
unset(
$_SESSION);
session_destroy();

header("Location: /app/login");

?>