Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php login system with admin features

include('class/User.php');
$user = new User();
$message =  $user->login();
Comment

login php

<!DOCTYPE html>  
 <html>  
      <head>  
           <title>Webslesson Tutorial</title>  
           <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  
           <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  
           <script src="jquery.js"></script>  
           <style>  
                #box  
                {  
                     width:600px;  
                     background:gray;  
                     color:white;  
                     margin:0 auto;  
                     padding:10px;  
                     text-align:center;  
                }  
           </style>  
      </head>  
      <body>  
      <?php  
      session_start();  
      if(isset($_SESSION["name"]))  
      {  
           if((time() - $_SESSION['last_login_timestamp']) > 60) // 900 = 15 * 60  
           {  
                header("location:logout.php");  
           }  
           else  
           {  
                $_SESSION['last_login_timestamp'] = time();  
                echo "<h1 align='center'>".$_SESSION["name"]."</h1>";  
                echo '<h1 align="center">'.$_SESSION['last_login_timestamp'].'</h1>';  
                echo "<p align='center'><a href='logout.php'>Logout</a></p>";  
           }  
      }  
      else  
      {  
           header('location:login.php');  
      }  
      ?>  
      </body>  
 </html>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel edit 
Java :: java get screen size 
Java :: dependency for spring security 
Java :: how to iterate through an array backwards java 
Java :: recycler view dependency 
Java :: print hello world in java 
Java :: bukkit scoreboard 
Java :: maven spring boot devtools install 
Java :: spring enable debug log level 
Java :: regex java email validation 
Java :: javafx dependency 
Java :: java integer to binary string with leading zeros 
Java :: age in java 
Java :: java double to long 
Java :: swing disable button 
Java :: java selenium new empty tab 
Java :: stringjoiner stream java 
Java :: java create a set with values 
Java :: array to map java1 
Java :: JFrame Exit oon close Java15 
Java :: how to format ddmmmyyyy to ddmmyy in java 
Java :: How do you print duplicate characters from a string? 
Java :: padding a string with 0 in java 
Java :: take string array input in java 
Java :: java get all items from arraylist 
Java :: java show error dialog 
Java :: ubuntu java compiler version 
Java :: react native webview debug network 
Java :: set html text android java 
Java :: java test if a string is a int 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =