I am using following PHP code to check session. But if the session is not logged into then page is not redirect just show the black page.
My If condition is right ! it is hitting header function ..
Here is my code:
|| (trim($_SESSION['SESS_MEMBER_ID']) == '')
HTTP/1.1 200 OK
Date: Wed, 10 Oct 2012 10:57:14 GMT
Server: Apache/2.2.15 (CentOS)
Content-Type: text/html; charset=UTF-8
If you're using
header("Location: "); after you've output content make sure you've put
ob_start(); earlier in the script.
ob_start(); buffers your script, so nothing is output until you either call
ob_end(); or the end of the file is reached. Calling
header("Location: "); after content has already been output to the browser can cause problems.