![]() |
Checking empty field then connect
I'm having issues figuring out what the problem is. I have a log in form that checks to see if the fields are empty, if they are, then it throws an error out. If they put something in both fields, it checks to see if they are a valid in the database.
PHP Code:
In my HTML I have Code:
<?php |
The problem with your code is the if (count($errors)) { on line 4 of the login function. Your error array is $error earlier in the code.
I see that you are passing in the username and password arguments, yet you are still looking for the POST values in the function. It may be better to use: Code:
function login($username, $password){Code:
if (isset($_POST['username'])) {--Andrew |
| All times are GMT. The time now is 03:11 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0