php - Login System Help - "Getting 4 errors" -


i these errors, when try use system.

 use of undefined constant session_id - assumed 'session_id' in c:\wamp\www\ucp\header.inc.php on line 16

mysql_fetch_assoc() expects parameter 1 resource, boolean given in c:\wamp\www\ucp\header.inc.php on line 21

mysql_num_rows() expects parameter 1 resource, boolean given in c:\wamp\www\ucp\header.inc.php on line 22

: use of undefined constant isloggedin - assumed 'isloggedin' in c:\wamp\www\ucp\dashboard.php on line 3

<?php session_start(); require_once("connection.php");  $user = isloggedin();  if($user) {     $expires = time() + (60 * 15);     mysql_query("update 'active_users' set 'expires' = " . $expires . " 'user' = " . (int) $user . "");  }  function isloggedin() {     $sessid = mysql_real_escape_string(session_id);     $hash = mysql_real_escape_string(hash("sha512", $sessid.$_server['http_user_agent']));      $query = mysql_query("select 'user' 'active_users' 'session_id' = '" . $sessid . "' , 'hash' = '" . $hash . "' , 'expires' > " . time() . "");      $data = mysql_fetch_assoc($query);     if(mysql_num_rows($query))     {         return $data['user'];     }     else {         return false;     }  } ?> 

1.use of undefined constant session_id: define session_id 2. mysql error change slect select 3. use of undefined constant isloggedin : pull isloggedin function in top of page. 

Comments