Page 1 of 1

PHP Login: Missing argument 2 for valid_credentials()

Posted: Tue Jun 14, 2011 9:14 pm
by twiggy
I'm almost there! Final video :D this forums bandwidth must love me!

Im about 8mins into the last video and you say to go on the login.php and check there are no syntax errors, but I get this when I try and login:
Warning: Missing argument 2 for valid_credentials(), called in C:\xampp\htdocs\user_system\login.php on line 14 and defined in C:\xampp\htdocs\user_system\core\inc\user.inc.php on line 12

Notice: Undefined variable: pass in C:\xampp\htdocs\user_system\core\inc\user.inc.php on line 14
From the reading I have done it seems I'm not passing valid_credentials enough arguments? I didn't realise I was passing valid_credentials any arguments until the submit button is pressed? or have I missed the point?

Re: PHP Login: Missing argument 2 for valid_credentials()

Posted: Tue Jun 14, 2011 9:30 pm
by Tino
Well obviously you're missing the second parameter... Which probably is something like $_POST['password']

What's your code?

Re: PHP Login: Missing argument 2 for valid_credentials()

Posted: Tue Jun 14, 2011 9:51 pm
by twiggy
oops my bad! I put a . instead of a , in if (valid_credentials($_POST['username'], $_POST['password']) === false)

Thanks Tino your comment made me look more closely at that part of the code

Re: PHP Login: Missing argument 2 for valid_credentials()

Posted: Wed Jun 15, 2011 1:20 am
by jacek
twiggy wrote:I put a . instead of a ,
I don't think I have ever done that, but I bet it would be hard to spot !