Wednesday, April 29, 2009

PHP SCRIPT-- TO TIME OUT THE SESSION AFTER THE PARTICULAR TIME [SESSION TIME OUT]

<?php
if (!isset($_SESSION['timeout_idle'])) {
$_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; //set time at the first time of writing script
} else {
if ($_SESSION['timeout_idle'] < time()) {
//destroy session if session time is less the what we have set the time
} else {
$_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; // if continue working on similar site then increase the time of script
}
}
?>

PHP- Remove Special Character during website

// put this code on the top of the page or in your config file. You will never see the special character on that page/website(if you used config on the top then it work on whole website)


header("Content-type: text/html; charset=UTF-8");
ini_set('mbstring.internal_encoding', 'UTF-8');

security header validate

  HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)