hi
when I logged in, the details (user ID & last loggin in time) should show in each pages... can anyone please help me how can I do this?
I have got login page with user name and password. when I logged in, it shows the details in the in each pages untill I logged out.
can anyone please help to how can I do this?

thanks

if (isset($userid) && isset($password)) {
  $link_id = db_connect();
  if(!$link_id) die(sql_error());
  $selsql = "select *, DATE_FORMAT(logndate,'%c/%e/%Y') as logindate FROM authuser where usrid='$userid'";
  $selsql .= " and password=password('$password')";
  $result = mysql_query($selsql);
  if (mysql_num_rows($result) > 0)
  {
   if ($myrow = mysql_fetch_array($result))
   {
     
     $_SESSION["Logged_In_User"] = $userid;
     $_SESSION["Last_Log_On"] = $logindate;
   }
}}

You need to have a session_start(); on each .php file

thanks a lot pnick... hope this will work...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.