Stopping A PHP 'if' Statement From Executing During Login
Posted January 11th 2013, 6:54pm
Hello,

For my forum, I am trying to design a feature that relies on PHP to function. The 'if' statement that is used in the PHP relies on the user ID to operate, but I am having a problem. I want the PHP code to be executed for the guest user ID, but whenever a user tries to log in that should not have the PHP code executed, it is getting executed anyway. Is there a way to stop the 'if' statement from executing during log-in?

Thanks in advance!

~ David B
φ
Posts: 280
Joined: October 2nd 2011, 11:00pm
Likes Given: 27
Likes Received: 4
Stopping A PHP 'if' Statement From Executing During Login
Posted January 11th 2013, 10:05pm
The user ID of guests in phpBB3 is 1, as is the ANONYMOUS constant. The following two conditionals will evaluate identically:

if ($user->data['user_id'] == 1)

if ($user->data['user_id'] == ANONYMOUS)

If that doesn't help, I'll need to see the code you're using.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 1 guest