Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Arrow Allowing members to place no more than 2 Adsense like Ads on same page

    Hello,
    We serve Adsense like Ads ( Free Clickbank Ads ) on the web pages of our members.
    For your reference : http://cbtopsites.com/affiliates/cbadscode.php
    We have mentioned on the site not to paste the code more than twice on the same page.

    However, some members are pasting the Ads code too many times on the same page. ( some have pasted it more than 10 times )
    That is causing problem to our server.

    I have been visiting the web pages of members everyday to see if they are pasting too many ads, but it is a tedious process.

    Is there any way to display the Ads only twice on a page
    and display some other text on the extra Ads?

    Hope you understood the problem.

    Please suggest possible solutions.
    Thank you

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Show us one of your member's page that has more than two ads.

  • #3
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Arrow

    Quote Originally Posted by mlseim View Post
    Show us one of your member's page that has more than two ads.
    I have blocked one such site using htaccess.
    http://weightlossrecipes.blogspot.com/

    You will find 403 forbidden message in the place of the Ads.
    ( he may remove the code anytime )

    That person has pasted the code fourteen times on the same page of his blog.
    Due to this problem, mysql slow queries log and cpu exceeded log are increasing.

  • #4
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    As a simple test, you could detect how many server requests for the contents of the iFrame(s) are being submitted by a single referer at "once" (in reality, time dither required) - too many requests per referer (i.e. more than two) = automatically block the domain and send a warning email.

    If your clients really want to abuse the system they would then be able to do so by forging the referer, but I think the method I've suggested would probably fix 90% of your problems ... although I don't know how dedicated/evil your customers are!

    Another, more robust but more complex solution would be to CURL in each and every one of the client's pages and parse them all for inclusion of your iFrame (more complex because you would need to parse the markup) - you would only need to do this periodically (and ideally randomly so as to be unpredictable) and deny access accordingly.
    Last edited by mlse; 01-07-2008 at 03:24 PM.

  • #5
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Arrow

    Quote Originally Posted by mlse View Post
    Another, more robust but more complex solution would be to CURL in each and every one of the client's pages and parse them all for inclusion of your iFrame (more complex because you would need to parse the markup) - you would only need to do this periodically (and ideally randomly so as to be unpredictable) and deny access accordingly.
    I am thinking of this method.

    I know how to use PHP to parse html web pages and find if some code is present there or not.
    I don't know about CURL.

    Thank you for your suggestion.

  • #6
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    You're welcome!

    CURL stands for Client URL ... very useful. Here's the documentation: http://uk3.php.net/manual/en/ref.curl.php

    Mind you, in the first instance I would just knock up a quick script to record the number of requests per referer over a period of say 2 or 3 days, just to get an idea of the size of the problem. Indeed, this information should already be present in your server's logfiles. You might be able to manually manage the problem adequately with a simple solution like that rather than going for a more complex one.
    Last edited by mlse; 01-07-2008 at 03:36 PM.

  • #7
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Arrow

    Quote Originally Posted by mlse View Post
    As a simple test, you could detect how many server requests for the contents of the iFrame(s) are being submitted by a single referer at "once" (in reality, time dither required) - too many requests per referer (i.e. more than two) = automatically block the domain and send a warning email.
    Can you please tell me how to do this.
    Thank you

  • #8
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Firstly, look in your logfile - that info should be in there already - you will need to mine the data and your webhost may provide logfile analysis tools as part of your hosting package.

    If that bears no fruit, then off the top of my head ...

    Record $_SERVER[HTTP_REFERER] and time of request ... if you see a whole load of requests for your advert pages bunched together in a very small space of time (less than a second) from the same referer then there's a good chance that page has too many ads on it.

  • Users who have thanked mlse for this post:

    student (01-07-2008)

  • #9
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Hello mlse,
    Thank you very much
    I will follow for your suggestions.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •