Jump to content

Unique Visitor Check


BUNN1E5

Recommended Posts

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

Link to comment
Share on other sites

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 by QuickOldCar
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 by paddyfields
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.