Thursday, June 28, 2007

PHP-A Unique session id


function MakeSessionId() {
$day = date('d', time());
$month = date('m', time());
$year = date('Y', time());
$hour = date('H', time());
$min = date('i', time());
$sec = date('s', time());

return sprintf("%02d%04d%02d-%02d%02d%04d-%04d-%02d%04d", $sec, rand(0, 9999),
$hour, $month, $min, rand(0, 9999), rand(0, 9999), $day, $year);
}

?>

Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script.

No comments: