Desii
Desii

Reputation: 55

Make sure one person can only put one input

I want to create a website that has just one input, Username, then I will use all usernames in the database to draw a winner later.

I need to make sure one person can only write their name once and all other entries will be deleted (manually or automatically, i dont care), I just need to tell if an user posted more than one entry

Is there any way to do this?

I found this solution to get the users IP

 Select SUBSTRING_INDEX(host,':',1) as 'ip' 
 From information_schema.processlist 
 WHERE ID=connection_id();

But then again one can use a VPN very easily. Is there any other solution?

Upvotes: 0

Views: 27

Answers (1)

Mihail Zhytnik
Mihail Zhytnik

Reputation: 66

Actually there is plenty of solutions which one by one is useless, but together they stand. You can use IP, as you said, also add some info to cookies/localStorage plus you may record user's browser User-Agent and some other metadata. The point is gather as much data as possible to determine who is who The more data you'll collect, the better stability will be. Good luck!

Upvotes: 1

Related Questions