Jump to content

logout page error after update?


RaythMistwalker

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.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.