| Generate unique user ID using uniqid () |
| Friday, 26 May 2006 | ||||
|
You sign up for a site and they generate you a unique user ID to use. One way to do this in PHP is to use the uniqid () function. This with generate a 13 or 23 character unique ID, which you can then add a prefix to if you desire. Once you send this to the user, you can then encrypt and store it in the database. Generating a unique ID for members of your site: Uniqid (prefix, more_entropy) 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. <?php
Only registered users can write comments. Powered by AkoComment Tweaked Special Edition v.1.4.6 |
||||
| Next > |
|---|

