Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi All,
I have used number of times drupal core function "user_authenticate" to authenticate the check if user exists, but not sure why the function is not returning anything this time while it is suppose to return the id of that user. Please help !!
$userId = user_authenticate('username', 'userpassword');
echo $userId;
Thanks,
Neeraj
Comments
Comment #1
dcam CreditAttribution: dcam commentedIs it not returning anything at all or is it failing to authenticate and returning FALSE?
If it's not returning anything, then my first guess is that the function is out of scope. Did you include the user.module file? Is there anything in your PHP error log that would indicate the problem?
Comment #2
dcam CreditAttribution: dcam commentedClosing old issues. The OP never replied back.