PHP Classes

File: login.php

Recommend this page to a friend!
  Classes of Alison Silva   Login and validate users Class   login.php   Download  
File: login.php
Role: Example script
Content type: text/plain
Description: The example file
Class: Login and validate users Class
Authenticate users with records in MySQL database
Author: By
Last change:
Date: 10 years ago
Size: 1,060 bytes
 

Contents

Class file image Download
<?php
require 'login.class.php';

$login = new HandlerForm();
$user = new ValidateUser();

if(
$user->getUserId()) :

?>
<div>Hello <?php echo $user->getUserName(); ?></div>
    <form action="" method="POST" id="logout-form">
        <input type="submit" value="Logout" >
        <input type="hidden" name="redirect" value="#logedout">
        <input type="hidden" name="dologout" value="dologout">
    </form>
   
<?php else : ?>

    <form action="" method="POST" id="loging-form" >
   
        <label for="username">
            Username:
        </label>
        <input type="text" name="username" placeholder="Username or email" value="">
        <div class="separator"></div>
        <label for="password">
            Password:
        </label>
        <input type="password" name="password" placeholder="Type your Password" value="">
        <div class="separator"></div>
        <input type="hidden" name="dologin" value="dologin">
        <input type="hidden" name="redirect" value="#loged">
        <input id="btnlogin" type="submit">
       
        <div class="message"><?php echo $login->message; ?></div>
   
    </form>

<?php endif; ?>