PHP Classes
elePHPant
Icontem

File: example/login.php

Recommend this page to a friend!
  Classes of Ashraf Gheith  >  PHP Secure Login and Registration  >  example/login.php  >  Download  
File: example/login.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Secure Login and Registration
Register and login users in a database with PDO
Author: By
Last change: Added filter_input instead accessing
Date: 2 years ago
Size: 338 bytes
 

 

Contents

Class file image Download
<?php
   
require_once '../class/user.php';
    require_once
'config.php';

   
$email = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_EMAIL);
   
$password = filter_input(INPUT_POST, 'password', FILTER_DEFAULT);

    if(
$user->login( $email, $password) ) {
        die;
    } else {
       
$user->printMsg();
        die;
    }