PHP Classes
elePHPant
Icontem

File: examples/basic/home.php

Recommend this page to a friend!
  Classes of Subin Siby  >  Secure PHP Login System  >  examples/basic/home.php  >  Download  
File: examples/basic/home.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Secure PHP Login System
Register and login users using a database via PDO
Author: By
Last change: Follow PSR standards
Formatted code to follow Francium coding standards

Formatted files using [phpfmt](https://github.com/subins2000/phpfmt) to follow Francium [coding standards](https://github.com/FranciumOS/Francium/blob/master/CODING-STANDARDS.md)
Replace spaces indentation with tabs
Date: 1 year ago
Size: 1,083 bytes
 

Contents

Class file image Download
<?php
require 'config.php';
if (isset(
$_POST['newName'])) {
   
$_POST['newName'] = $_POST['newName'] == '' ? 'Dude' : $_POST['newName'];
   
$LS->updateUser(array(
       
'name' => $_POST['newName'],
    ));
}
?>
<html>
    <head></head>
    <body>
        <h1>Welcome</h1>
        <p>You have been successfully logged in.</p>
        <p>
            <a href="logout.php">Log Out</a>
        </p>
        <p>
            You registered on this website <strong><?php echo $LS->joinedSince(); ?></strong> ago.
        </p>
        <p>
            Here is the full data, the database stores on this user :
        </p>
        <?php
        $details
= $LS->getUser();
        echo
'<pre>';
       
print_r($details);
        echo
'</pre>';
       
?>
<p>
            Change the name of your account :
        </p>
        <form action="home.php" method="POST">
            <input name="newName" placeholder="New name" />
            <button>Change Name</button>
        </form>
        <p>
            <a href="change.php">Change Password</a>
        </p>
    </body>
</html>