Jump to content

check this function... and help please


watthehell

Recommended Posts

function is_user()

  {

if(isset($_SESSION['ISUSER']))

  {

return $this->check_session($_SESSION['ISUSER']);

  }

  else

  {

  return false;

  }

  }

 

can anyone explain what this function does....  ??? ??? ???

 

 

It is very hard to determine what this function does 'watthehell'.  Though at a guess. I would say it checks to see if the user is logged in.  Perhaps applies the user details to session variables?  It depends what the check_session function does.

 

Also, remember! Code tags.

check session function is like this ...

 

function check_session($val)

{

  return $val;

 

  $errmsg="Session has been expired.";

  if(isset($val)) return $val;

 

  $this->abort("Session Error ", $errmsg);

//  $this->redirect($this->error_template);

  exit;

}

 

///

i just wanted to ask how to use that function is_user() in php code....  ;D

 

can we use like this

 

<? if is_user()==true { ?>

display message u are logged in

<? } else { ?>

display login box

<? } ?>

sorry to say.... it didnt work, it gets logged in but does not show "You are now logged in", it shows the textbox to enter username and password........ :( :( :( :(

 

Well it will do if the login form isn't in the if statement..

I think your check_session function is messed up a bit.  You pass it the variable $val, and then, before ANY other code executes, you return $val.  So if you do this: $user = is_user();, then $user == $_SESSION['ISUSER'].  I would assume that would return "Admin", "Guest", "Registered", etc.

 

Please post your whole code so we can see more.  Just those two functions aren't enough to say "OK, here's what's wrong".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.