php - what is the main function of uniqid(”, true)? -


i'm studying login system @ http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/.

and want ask, main function of uniqid(”, true)?
tutorial website says

"user unique id – generating unique user id in php using uniqid(”, true) function. sample user id 4f074eca601fb8.88015924"

why must generate user id? security or what?

thank guys.

this mysql query database.

create table users( uid int(11) primary key auto_increment, unique_id varchar(23) not null unique, name varchar(50) not null, email varchar(100) not null unique, encrypted_password varchar(80) not null, salt varchar(10) not null, created_at datetime, updated_at datetime null ); /** creating users table **/ 

maybe unique_id used data submission. example, submitting form ajax may require user id of person submitting it, prevent hackers changing data sent server, unique id used make change useless cuz don't know pattern of how people assigned ids. reason, unique id might useful in, might used in url show profile of someone. example: profile.php?id=unique_long_id prevents people knowing how many users exist in website ... there unlimited ways can creative unique ids :)


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -