View Full Version : session check/query

02-25-2007, 10:46 PM
How do i make it to where if(empty($_SESSION['id'])) , run the following code:

if($_SERVER['HTTP_REFERER'] =="http://www.site.com"){
header("location: http://google.com");

02-26-2007, 12:32 AM
if (!isset($_SESSION['id'])) {
code to run is session isn't set.

02-26-2007, 01:08 AM
doesn't work... it runs the query regardless rather/rather not the session is set

02-26-2007, 01:33 AM
It is likely that sessions are not configured or are not working. Either check your web server log for errors or put the following two lines in after your first opening <?php tag in each file that you have -

ini_set ("display_errors", "1");
error_reporting(E_ALL);Also, if this code is checking for $_SESSION['id'], are you sure that it is being set. Posting your actual code will also help anyone help you find out why it is not working.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum