I\'d like to generate a secure one-click-access type of url similar to the examples below. I\'ll be using PHP but that is irrelevant as I\'m just looking to understand the under
Try uniqid - and perhaps combine with an md5 hash, as given in the examples:
// no prefix
// works only in PHP 5 and later versions
$token = md5(uniqid());
// better, difficult to guess
$better_token = md5(uniqid(rand(), true));
I must note however that no urls generated in this way (whatever the hash algorithm) will be 'secure', simply very difficult to guess.