redirect on logout

Hello everyone,

I am having issues with my logout redirect. Was working fine and stopped working all of a sudden. The errors I am getting are:

Warning: mysql_close() expects parameter 1 to be resource, boolean given in /home/www30mdg/public_html/admin/logout.php on line 11

Warning: Cannot modify header information - headers already sent by (output started at /home/www30mdg/public_html/admin/logout.php:11) in /home/www30mdg/public_html/admin/logout.php on line 13

My code for logout.php is:

<?php require_once $_SERVER["DOCUMENT_ROOT"].'/admin/logging/logInit.php'; $log->mylog('access','Logout',''); session_start (); @include ("xp/config.php"); $_SESSION = array (); // Empty the session session_destroy (); // Destroy the session mysql_close ($link); // Close the database connection for security reasons header ("Location: /admin/index.php"); // Redirect the user die; ?>

Appreciate any feedback on this.
Thanks

Is $link being defined in this file somewhere?
[php]require_once $_SERVER[“DOCUMENT_ROOT”].’/admin/logging/logInit.php’;[/php]
The error is saying it’s trying to close the connection to a db resource that doesn’t exist. I’ve never seen a db close connection in a logout page before, not that it can’t be there. If you can’t find where $link comes from, just remove the mysql_close() line.

The header error is likely from the print out of the other error before it.

Thanks fastsol. I removed the mysql_close line and all is good… New to php and always looking around for some good learning sites. If you know of any, please let me know…

Thanks again

Sponsor our Newsletter | Privacy Policy | Terms of Service