PHP Classes
elePHPant
Icontem

File: example/register.php

Recommend this page to a friend!
  Classes of Ashraf Gheith  >  PHP Secure Login and Registration  >  example/register.php  >  Download  
File: example/register.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: Fix of registration problem mentioned by San Hiscio
Date: 2 years ago
Size: 585 bytes
 

 

Contents

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

   
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
   
$fname = filter_input(INPUT_POST, 'fname', FILTER_SANITIZE_STRING);
   
$lname = filter_input(INPUT_POST, 'lname', FILTER_SANITIZE_STRING);
   
$pass = filter_input(INPUT_POST, 'password', FILTER_DEFAULT);

    if(
$user->registration($email, $fname, $lname, $pass)) {
        print
'A confirmation mail has been sent, please confirm your account registration!';
        die;
    } else {
       
$user->printMsg();
        die;
    }