Anti Cheating System

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jose
    replied
    Originally posted by Dj-marc View Post
    bro if u aint helping dont reply ok?
    Sorry dawg... Let me try to help then..

    I suppose you have a table like this below

    Code:
    CREATE TABLE `hits_table` (
        `id` int(11) AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `referer` int(11) NOT NULL,
        `user_ip` varchar(100) NOT NULL,
        `user_agent` varchar(250) NOT NULL,
        `datetime` datetime NOT NULL
    )
    referer = The website owner's ID supplying the hit
    user_ip = The user who is directed's ip
    user_agent = The user who is directed's browser
    datetime = The datetime in which he/she directed to your site and a hit IS saved

    WATCH CLOSELY now (i am about to pull a rabbit out of the hat ):

    Before you save a click(hit) you MUST query to the database to check whether the user browsing has been saved as a hit. That can be achieved with an SQL stement like the one below:
    SELECT * FROM hits_table WHERE referer='$referer' AND user_ip='$user_ip' AND datetime > '$datetime_in_30_minutes_back_or_less';

    $datetime_in_30_minutes_back_or_less can be found by using the [datetime using the current datetime MINUS (-) 30 minutes or whatever time captcha you want to use]

    dont allow a user to execute a DETELE statement (unless your not serious)

    Try the suggestion and ask if your still stuck.

    Leave a comment:


  • CreativityKills
    replied
    just use ip n brws logging or sumfin dat expires in 30mins and deletes frm database.

    Leave a comment:


  • Dj-marc
    replied
    bro if u aint helping dont reply ok?

    Leave a comment:


  • Jose
    replied
    What are you really trying to achieve? hehe...
    Please elaborate man

    And BTW: What does the above do?
    Remove that code from your script, maybe everything will be just fine

    Leave a comment:


  • Dj-marc
    started a topic Anti Cheating System

    Anti Cheating System

    How can I add codes to a toplist script to prevent users from cheating by refreshing the page and getting hits for their site to be on top?
    something like on surfwap
    here is the code on the index.php page
    PHP Code:
    if($sid>0)
    {
        
    $sites=mysql_fetch_array(mysql_query("SELECT * FROM sites where id='".$sid."' and banned='0';"));
        
    $hin=$sites[6]+1;
        
    mysql_query("UPDATE sites SET hin='".$hin."' WHERE id='".$sid."'");    

    Last edited by Dj-marc; 05.07.09, 20:12.
Working...
X