markbett Posted October 5, 2006 Author Share Posted October 5, 2006 ok the code on that page now looks somethign like this:[code]<? var_dump($_SESSION); echo "<hr>"; //determien the event hosts name $sql = mysql_query("SELECT first_name, last_name, email_address AS host_email FROM users WHERE id ='$event_host'") //id ='15'")// or die (mysql_error()); if(!$sql){ echo 'Error getting determining event host: '. mysql_error(); } else { while($row = mysql_fetch_array($sql)){ stripslashes(extract($row)); $event_host = $first_name.' '.$last_name; } } var_dump($_SESSION); ?>[/code]you can see THAT is the section of code that is causeing the session variable to be RESET WHY???my login script ONLY should set those if the login isnt set to being true [code]if($_SESSION['login'] != TRUE){echo "i ran again cause i suck"; $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $validate = mysql_query("SELECT * FROM users WHERE username='$username' AND password = md5('$password') AND verified='1' AND disabled='0' ") or die (mysql_error()); if(mysql_num_rows($validate) == 1){ while($row = mysql_fetch_assoc($validate)){ $_SESSION['login'] = true; $_SESSION['userid'] = $row['id']; $_SESSION['first_name'] = $row['first_name']; $_SESSION['last_name'] = $row['last_name'];[/code]wtf is going on..... Quote Link to comment Share on other sites More sharing options...
Hi I Am Timbo Posted October 5, 2006 Share Posted October 5, 2006 do you have oh, what is it called, session register globals or something like that, where session variables become normal variables? do this: echo ini_get('register_globals');If that is on or true or whatever, that is your problem. &$first_name == &$_SESSION['first_name']I think that is the problem. Sorry for the slow response, I went out for the night. Quote Link to comment Share on other sites More sharing options...
markbett Posted October 5, 2006 Author Share Posted October 5, 2006 i looked through the php manual and i dont see anything indicating that register globals results in session variables overwriting non session... anyone Quote Link to comment Share on other sites More sharing options...
markbett Posted October 5, 2006 Author Share Posted October 5, 2006 aanyone Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.