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); } } ?> Link to comment https://forums.phpfreaks.com/topic/110761-fatal-error-this-object-context-missing-argument-in-custom-function-help/ 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 Link to comment https://forums.phpfreaks.com/topic/110761-fatal-error-this-object-context-missing-argument-in-custom-function-help/#findComment-568236 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.