Generating a unique ID for members of your site:
A unique site ID can be created in PHP using the uniqid () function. This function has two parameters we can set. The first is the prefix. This is what will be appended to the beginning of each ID. The second is more_entropy. If this is false or not specified it will return 13 characters, if it is true then 23 characters will be returned.
Here are some examples:
//creates a unique id with the 'about' prefix $a = uniqid(about); echo $a; echo "<br>";
//creates a longer unique id with the 'about' prefix $b = uniqid (about, true); Echo $b; echo "<br>";
//creates a unique ID with a random number as a prefix - more secure than a static prefix $c = uniqid (rand (),true); echo $c; echo "<br>";
//this md5 encrypts the username from above, so its ready to be stored in your database $md5c = md5($c); echo $md5c; ?>