Skip to content

Instantly share code, notes, and snippets.

@davewardle

davewardle/login.php Secret

Created Jul 11, 2017
Embed
What would you like to do?
Login logic
<?php
$user = sql_select_first( $user_table, '*', "email = '" . secure( $form['email'] ) . "' AND password = '" . secure( $form['password'] ) . "'", '' );
if ( count( $user ) > 0 ) {
$_SESSION['user'] = $user;
// ...
} else {
$_SESSION['user_warning'] = 'Login failed:<br />Email address and password did not match';
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.