Posts: 2,536
Location: Western Maryland
|
fambi,
The IP address of your user can be extracted in a PHP script using $_SERVER[REMOTE_ADDR]. It is just a string. microtime() returns the current time. md5() is a common hash function that can be used to convert a string into a 32-bit hexadecimal number.
So here is a function to create the uniqueID you mentioned. I can't test it where I am, but anytime you need a unique identifier, just call this method and the chances are astronomical that you would ever receive two identical uniqueIDs.
PHP Code:
function getUniqueID()
{
return md5( $_SERVER[REMOTE_ADDR] . microtime() );
}
__________________
—Kyrnt
|