Jump to content

Recommended Posts

<?php
ini_set('display_errors', 'on');
error_reporting(E_ALL);
//Start session
session_start();
        $sessId=$_SESSION['SESSION_ID']);

//Unset the variables stored in session
unset($_SESSION['SESS_MEMBER_ID']);
unset($_SESSION['SESSION_ID']);
        
        //Remove Session from Database
        include('config.php');
        //Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}

//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
	die("Unable to select database");
}
        $qry="DELETE FROM sessions WHERE sess_id=$sessId";
        $result=mysql_query($qry);
        mysql_close();
        

?>

 

Ok basically this worked before when i never had to connect to the database to remove session info. Now it isn't logging out and just showing blank page. my mind is just blank and i think its missing something stupid like ( [ ) ] or ; but i can't see it. anyone?

Link to comment
https://forums.phpfreaks.com/topic/187411-logout-page-error-after-update/
Share on other sites

You have a fatal parse error on line 6.

 

Fatal parse errors are only displayed when you set the error_reporting/display_errors settings before your script is parsed. You need to set those two values in your master php.ini on your development system to save yourself a lot of time.

You should be learning php, developing php code and debugging php code on a local development system, for a couple of reasons. Doing this on a live server wastes a huge amount of time in constantly uploading files on every alteration and until your code is complete and tested it likely contains security holes that would allow a hacker to exploit your server.

 

You can set those two settings in a .htaccess file (when php is running as an apache module) or in a local php.ini (when php is running as a CGI application.)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.