Login   Register  
PHP Classes
elePHPant
Icontem

File: demo/login.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Damian Stepien  >  Simple PHP User Authentication  >  demo/login.php  >  Download  
File: demo/login.php
Role: Example script
Content type: text/plain
Description: Example - login.php
Class: Simple PHP User Authentication
Authenticate users with records in a MySQL table
Author: By
Last change:
Date: 2013-08-31 13:10
Size: 356 bytes
 

Contents

Class file image Download
<?php
include '../userauth.class.php';
$auth = new UserAuthentication();

if(isset(
$_POST['login']) && isset($_POST['pass'])) {
    if(!
$auth->logIn($_POST['login'], $_POST['pass'])) {
        
header("Location:index.php?login=error");
    }
    else {
        
header("Location:index.php");
    }
}
else {
    
header("Location:index.php?login=error");
}
?>