JezK
Edit File: admin.php
<?php // start session session_start(); // set time for session timeout $currentTime = time() + 25200; $expired = 3600; // if session not set go to login page if(!isset($_SESSION['user'])){ header("location:index.php"); } // if current time is more than session timeout back to login page if($currentTime > $_SESSION['timeout']){ session_destroy(); header("location:index.php"); } // destroy previous session timeout and create new one unset($_SESSION['timeout']); $_SESSION['timeout'] = $currentTime + $expired; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/custom.css"> <title>Pharisee</title> <link rel="icon" href="./images/icons/favicon.png" type="image/icon type"> </head> <body> <div id="container"> <?php include('public/menubar.php'); ?> <?php include('public/admin-form.php'); ?> <?php include('public/footer.php'); ?> </div> <script src="css/js/jquery.min.js"></script> <script src="css/js/bootstrap.min.js"></script> <script> function addedvalidation() { var confirm_password=document.getElementById("confirm_password").value; var new_password=document.getElementById("new_password").value; var old_password=document.getElementById("old_password").value; var t=true; if(old_password.trim()=="") { alert("Please enter old password"); document.getElementById("old_password").focus(); return false; } if(old_password != ""){ $.post('public/ajaxcall.php?type=4&old='+old_password,function(data){ // alert(data); if(data==0) { alert("Old password wrong"); document.getElementById("old_password").focus(); return false; } }); // return t; } //return false; if(new_password.trim()=="") { alert("Please enter new password"); document.getElementById("new_password").focus(); return false; } if(confirm_password.trim()=="") { alert("Please enter confirm password"); document.getElementById("confirm_password").focus(); return false; } if(confirm_password.trim()!=new_password.trim()) { alert("Password did not matched"); document.getElementById("confirm_password").focus(); return false; } } $(document).ready(function(){ var old=$('#old_password').val(); window.setTimeout(function() { $(".alert").fadeTo(500, 0).slideUp(500, function(){ $(this).remove(); }); }, 2000); }); </script> </body> </html>