lilwing Posted June 18, 2008 Share Posted June 18, 2008 I am trying to make a set session function for a backend CMS application. Really need to get this working, and I am not sure what I have done wrong. It's probably because I am new to $this variables. <?php function _setSession() { $this->id = $values->id; $_SESSION['uid'] = $this->id; $_SESSION['username'] = htmlspecialchars($values->username); $_SESSION['logged'] = true; if ($init) { $session = $this->db->quote(session_id()); $ip = $this->db->quote($_SERVER['REMOTE_ADDR']); mysql_select_db('sfisdb'); $sql = "UPDATE users SET session = $session, IP = $ip WHERE " . "id = $this->id"; $this->db->query($sql); } } ?> Quote Link to comment Share on other sites More sharing options...
tapos Posted June 18, 2008 Share Posted June 18, 2008 i didn't see any object. You can't use $this variable without object 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.