How to maintain login and logout session time in php 1 maintain login session time with login page code is below <?php include "config.php"; session_start(); $count=0; if(isset($_POST['submit']) and $_POST['submit'] =="Sign In") { $sql ="select * from user where name ='". $_POST['name']."' and password ='". $_POST['password']."'"; $run = mysql_query($sql); $count=mysql_num_rows($run); if($count > 0) { while($data=mysql_fetch_array($run)) { $id = $data['id']; $type = $data['type']; } $_SESSION['name'] = $_POST['name']; $_SESSION['id'] = $id; echo $_SESSION['type'] = $type; header ("location:index.php"); if($count == 1) { echo $_date = date("y/m/d") ; date_default_timezone_set("Asia/Calcutta"); //India time (GMT+5:30) echo $_time = date...
Posts
Showing posts from August, 2019
- Get link
- X
- Other Apps
How to Add conformation box "Are you sure you want to delete this record?" before delete record from database in your software. 1 Add java script in your application <script type = "text/javascript" > function clicked () { if ( confirm ( 'Do you want to submit?' )) { yourformelement . submit (); } else { return false ; } } </script> Then Add code in your button like below <input type="submit" onclick="return confirm('Are you sure You want to delete this user?')" name="deleteuser" style="background-color:red;color:white; id="deleteuser" value="Delete" placeholder="Movie Name" required="">