Article suggestions
  1. Home
  2. Section: Developer Hub
  3. PHP Code Snippet to Check If a Member/User is Logged In

PHP Code Snippet to Check If a Member/User is Logged In

PHP Code Snippet to Check If a Member/User is Logged In
  • avatar
Written by Chan Nier
Updated on February 19, 2025

 Link: https://support.brilliantdirectories.com/support/solutions/articles/12000095724

The code snippet below will determine if members are currently logged into their accounts on the website.

<?php
// Check if the user is not logged in
if (user::isUserLogged($_COOKIE)) {
?>

TEXT TO DISPLAY WHEN MEMBER LOGGED IN

<?php } ?>

Replace "TEXT TO DISPLAY WHEN MEMBER LOGGED IN" with your desired content. This content will be displayed only when a user is logged in.


Thank you for leaving a rating!
Did you find this article helpful?
0 out of 0 people found this article helpful so far
Can't find what you're looking for? Get in touch
How can we help?
Send your question below and we'll get back to you as soon as possible.
Cancel
translation missing: en.kb.default.contact_form_error
×
Thanks for your message!
Thanks for your message!
×