0

I have problem with login page that worked well before. Error is "Fatal error: Uncaught Error: Call to undefined method stdClass::signupTimeStamp()". My code derived from UserCake system of authentication.

<div id='main' style='display:none' >

Hey, $loggedInUser->displayname. This is an example secure page designed to demonstrate some of the basic features of UserCake. Just so you know, your title at the moment is $loggedInUser->title, and that can be changed in the admin panel.   You registered this account on " . date("M d, Y", $loggedInUser->signupTimeStamp()) . " .    usercode is: $loggedInUser->user_id.
</div>

dashboard.php

class loggedInUser {

    public $email = NULL;
    public $hash_pw = NULL;
    public $user_id = NULL;
    public $age= NULL;
    public $nome= NULL;
    public $dob= NULL;
    public $username = NULL;


    //Return the timestamp when the user registered
    public function signupTimeStamp()
    {
        global $mysqli,$db_table_prefix;

        $stmt = $mysqli->prepare("SELECT sign_up_stamp
                FROM ".$db_table_prefix."users
                WHERE id = ?");
        $stmt->bind_param("i", $this->user_id);
        $stmt->execute();
        $stmt->bind_result($timestamp);
        $stmt->fetch();
        $stmt->close();
        return ($timestamp);
    }

class.user.php

aynber
  • 22,380
  • 8
  • 50
  • 63
mino n
  • 31
  • 6
  • Possible duplicate of [Reference - What does this error mean in PHP?](https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – miken32 Jun 26 '19 at 18:27
  • where does the $loggedInUser variable come from? – slepic Jun 26 '19 at 18:42
  • //Global User Object Var //loggedInUser can be used globally if constructed config.php – mino n Jun 27 '19 at 07:47

0 Answers0