session_start();
// In seconds, so 900 is 15min
$inactive = 900;
if(isset($_SESSION['start']) ) {
$session_life = time() - $_SESSION['start'];
if($session_life > $inactive){
header("Location: user_logout.php");
}
}
$_SESSION['start'] = time();
Tuesday, 24 January 2012
Php time out sample code
Friday, 20 January 2012
MySql admin Create user / root privs
MySql admin commands
Option 1 - New user, Dedicated commands
========
Option 2 - New user, Direct sql
========
Root privs
Ref: http://www.databasef1.com/tutorial/mysql-create-user.html
Option 1 - New user, Dedicated commands
========
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user1'@'localhost';
Option 2 - New user, Direct sql
========
INSERT INTO user (Host,User,Password,Select_priv,Insert_priv)
VALUES('%','user4',PASSWORD('pass3'),'Y','Y');
Root privs
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%'
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'localhost'
FLUSH PRIVILEGES;
Ref: http://www.databasef1.com/tutorial/mysql-create-user.html
Subscribe to:
Posts (Atom)