PHPycho wrote:Which one do you prefer among the two?
The first one, mainly because this use of uniqid() is rather idiomatic compared to the second version which theoretically can be deduced if you know the instant of time in which it was computed.
PHPycho wrote:also you can suggest alternatives.
halojoy's suggestion has merit, but it has the property that elements are not repeated. This actually reduces the total number of possibilities. It may be better to just select at random from the entire range until the required number of characters has been reached.
halojoy wrote:Have you experienced bots pick correct text from an image captcha?
And in that case, how do you know it was a bot and not a human?
Indeed bots can pick correct text from an image CAPTCHA, depending on the quality of the CAPTCHA and the bot 🙂
However, it is also common for a man in the middle attack to be used instead, e.g., the bot takes your CAPTCHA image, uses it as a CAPTCHA for a porn website, and then fills in the answer that the porn viewer provides.