BUNN1E5 Posted June 10, 2014 Share Posted June 10, 2014 I want to to check if a person who comes to my site is either new or recurring and allow a download ONLY if they are new to the site. I would like to do something like check the IP adress of the person and see if it is in the database. I have never programmed in php before so it is entirely new to me, so i would like you to help me by writing an example script that does this that i can modify.Thank You Quote Link to comment https://forums.phpfreaks.com/topic/289095-unique-visitor-check/ Share on other sites More sharing options...
QuickOldCar Posted June 10, 2014 Share Posted June 10, 2014 (edited) ip's change, is not a reliable way to do it. For something like this are better off that users have to log in and that user can only do it once. No method is foolproof but the user way is a better option. Sure a user can sign up again, is more of a task though, eliminate signing up same email helps. This forum is for helping people with coding, not creating it. Is a freelance section here can ask http://forums.phpfreaks.com/forum/77-job-offerings/ Edited June 10, 2014 by QuickOldCar Quote Link to comment https://forums.phpfreaks.com/topic/289095-unique-visitor-check/#findComment-1482362 Share on other sites More sharing options...
PoH Posted June 10, 2014 Share Posted June 10, 2014 If you insist on checking the IP here's the general outline of what to do (not the code! that's not what this section is for). Use the mysqli extension for this. You can learn about it here. Connect to database Check if IP is existing in database. Get clients IP from using $_SERVER['REMOTE_ADDR'] If it doesn't exist, insert ip into database and download. else do whatever. Quote Link to comment https://forums.phpfreaks.com/topic/289095-unique-visitor-check/#findComment-1482377 Share on other sites More sharing options...
paddy_fields Posted June 10, 2014 Share Posted June 10, 2014 (edited) Just ask them to provide an email address, then automatically generate an email to that address with a unique download link which will only work once (use a token in the URL). Insert the email address into your database, and check whether that email address has been previously used before sending the email. If it has been used already, alert the user. Edited June 10, 2014 by paddyfields Quote Link to comment https://forums.phpfreaks.com/topic/289095-unique-visitor-check/#findComment-1482378 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.