Skip to content

Instantly share code, notes, and snippets.

@davewardle
Created July 11, 2017 15:27
Show Gist options
  • Save davewardle/5403be886443ce24e7dc7ddadb8ee068 to your computer and use it in GitHub Desktop.
Save davewardle/5403be886443ce24e7dc7ddadb8ee068 to your computer and use it in GitHub Desktop.
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