So i am trying to create independent web pages via PHP for practice im trying to learn.
What i want to do is to create unique URLs for each entry on my site.
Lets say my website is simple, it just asks the user to enter a name and records it to the database, and creates a unique URL for that user so he can go to his url and view his name.
I am looking to create a URL for each user lets say upto 8 characters a-z A-Z 0-9
that would look like url.com/uI53841a
So if John goes to create a website it creates a url he can visit url.com/uI53841a
for example.
My database would look like this below:
create table if not exists `entry` (
`uniqueURL` VARCHAR(8),
`name` VARCHAR(16),
primary key (`uniqueURL`)
) engine=innodb default charset=utf8;
How would i go about generating a unique ID for each person who submits their name to my site? And how do i go about making sure there are never any duplicates?
I am new to PHP and trying to learn, i see you can create md5 hashses but how can you randomize that and check theres no duplicates?