Jump to content

Php Functions Within If Statements


Far Cry

Recommended Posts

<?php
class Session {


public $loggedin;


public function CheckLogin($userid,$username)
{
if(isset($userid) && isset($username)){
 $this->loggedin = true;
 } else {
 $this->loggedin = false;
 }
return $this->loggedin;
}
public function Login(){

if($this->CheckLogin(....?)){


 }
}
}
?>

 

Would I need to pass the variables to the CheckLogin function in the if statement to get the true/false value? If so, how?

Link to comment
https://forums.phpfreaks.com/topic/272292-php-functions-within-if-statements/
Share on other sites

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.