0

I have a website where your able to advertise things on my website. The problem is that people are able to do it more than once. Is there a way that people are allowed to visit the website and when they join back they will be redirected to another page saying you have already advertised. People are still able to use vpn's but i have a way to stop that.

How can i use javascript or php to record the users ip first when the visit the website, But if they leave the website or reload the page they will be redirected to another page saying you have already advertised. Is this to much work?

5
  • please post the code demonstrating your efforts thus far Commented Apr 25, 2014 at 16:30
  • And what happens for those users that inherit an already blocked IP via DHCP? Commented Apr 25, 2014 at 16:30
  • 2
    Javascript certainly is not your answer, it's easy to circumvent. Use a database to store the IP, gotten with one of a million "IP detection" scripts on google, and when they return to the site you'll check for an instance of the IP and do whatever it is you need. Note, however, that IPs are not always reliable and it's fairly easy to circumvent IP checks. Commented Apr 25, 2014 at 16:32
  • You could also create user accounts and require logging in to post advertisements. Before allowing someone to post and ad, check some flag on their account (something like hasPosted). If the check passes, allow them to post, and then set the flag. If the check does not past, redirect them. Commented Apr 25, 2014 at 16:34
  • A user's IP address is not a very good unique identifier because most corporate users will be behind a firewall that uses NAT and often does not associate an IP address uniquely with one particular user. It sounds like you need a user login system where a user must login in order to use your services and you can then associate a login with what they are allowed to do. Commented Apr 25, 2014 at 16:36

2 Answers 2

2

Technically yes, you could use JS and PHP to grab a user's IP address and work with it in a database but proxies and dynamic IPs would make it a very easy check to circumvent. You can also use PHP to create a persistent cookie to identify the user and his/her actions and see if you're getting a returning visitor who posted an ad, but cookies can easily be deleted.

So it's not that what you're trying to do is too much work, it's that it's fairly easily circumvented and not very reliable. Your best bet is an authentication system that requires a valid login to post an ad, logging what the advertisers do, and creating logic which will disallow spammy behavior based on your logs.

You won't be able to stop abuses by very, very determined users but you can make it harder and make them think twice about whether it's worth investing all that time and effort into spamming on your site when there are bound to be much softer targets, giving you the time to deal with the most egregious cases personally instead of trying to stop a torrent of spammy ads.

Sign up to request clarification or add additional context in comments.

Comments

0

You cannot stop people doing that 100% for sure. if you block their IPs they use proxy. if you use session they change their browsers or reset it to default. if you block their hardware like in facebook block hard disk serial again they use vpn servers. if ..
there is no way bro. Ask for paying instead of making it for free.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.