Forum Moderators: coopster
I have a session id that I use for an order to put in the database and also to get it out of the database. But when you place the order you have to close the browser so you get a new session_id. Because now it puts the items by the same session_id in the database and display al the the items of that session id. I want to generate a new session_id but I have not the option regenerate_session() because the hosting server dus not support that version of php. Someone has a idea to asign a new session_id to session_id()?
Thanks alot
[edited by: ikke at 6:08 am (utc) on April 19, 2005]
<?
function randomNumber () {
$length ="32"; // the length of the number required
$possible = '0123456789qwertyuiopasdfghjklzxcvbnm';
$str ="";
while (strlen($str) < $length) {
$str.=substr($possible, (rand() % strlen($possible)),1);
}
return($str);
}
$id=randomNumber();
?>