Use this function uniqid - http://www.php.net/manual/en/function.uniqid.php