Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once 'core/init.php';
- if(logged_in() === TRUE) {
- header('location: dashboard.php');
- }
- // form submiited
- if($_POST) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username == "") {
- echo " * Username Field is Required <br />";
- }
- if($password == "") {
- echo " * Password Field is Required <br />";
- }
- if($username && $password) {
- if(userExists($username) == TRUE) {
- $login = login($username, $password);
- if($login) {
- $userdata = userdata($username);
- $_SESSION['id'] = $userdata['id'];
- header('location: dashboard.php');
- exit();
- } else {
- echo "Incorrect username/password combination";
- }
- } else{
- echo "username does not exists";
- }
- }
- } // /if
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement