0

In Drupal I'm getting the error below while using the user_is_logged_in function. Can you help me to resolve it? I'm tying to integrate a PHP file with Drupal.

"Call to undefined function user_is_logged_in()"

Solution: "PHP Filter" module provides the solution to integrate the HP code with Drupal.
Enable "PHP Filter" -> Add PHP code in node -> Select "PHP CODE" instead of Full HTML -> Save

Using Drupal 7

1 Answer 1

2

instead of using user_is_logged_in(), try the following:

global $user;
if($user->uid)
{
    // execute some code
}
Sign up to request clarification or add additional context in comments.

1 Comment

Or you can use the globals array $GLOBALS['user']->uid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.