PHP Classes

File: demo/login.php

Recommend this page to a friend!
  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: 10 years ago
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");
}
?>