PHP Login: Missing argument 2 for valid_credentials()

Post here is you are having problems with any of the tutorials.
Post Reply
twiggy
Posts: 58
Joined: Sat Jun 11, 2011 11:11 pm

PHP Login: Missing argument 2 for valid_credentials()

Post 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?
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

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

Post by Tino »

Well obviously you're missing the second parameter... Which probably is something like $_POST['password']

What's your code?
Please check out my CodeCanyon items.
twiggy
Posts: 58
Joined: Sat Jun 11, 2011 11:11 pm

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

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

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

Post 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 !
Image
Post Reply