point when you login on a site

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

    point when you login on a site

    hi there every one

    can some one help me with coding for when a member logs on they get 50 points for login on and 50 points when they log out..

    I am using ori's script the wapdesire v_2 script i think this would be good if any one can help me out please
    HELP THEM WHO HELPS YOU



    i only work on wapdesire v_2 coding only

    #2
    when the user arrive with link like username+pass&session insert into db 50poits by $_GET USERNAME.anyway, flood its a problem.so you need to check last date of login and if is < current date- 24h update points.i think.
    and abt log out-when you set out and before you delete session make update by user on points row.
    Last edited by blackhowk; 06.10.09, 07:10.
    http://ngeo.ro

    Comment


      #3
      Originally posted by blackhowk View Post
      when the user arrive with link like username+pass&session insert into db 50poits by $_GET USERNAME.anyway, flood its a problem.so you need to check last date of login and if is < current date- 24h update points.i think.
      and abt log out-when you set out and before you delete session make update by user on points row.
      sorry do not under stand what your saying
      HELP THEM WHO HELPS YOU



      i only work on wapdesire v_2 coding only

      Comment


        #4
        ok.
        if you want to assign some points for each user when the 'user' proceed to login, you must know date of last login.
        you can not attach points for every login since it would encourage logging multiple actions to collect points.
        every 24 hours regardless of how many times it gets points login
        to do so follow the example below:

        $sql = "UPDATE 'USER_TABLE' SET 'POINTS' = 'points+$p' WHERE `time` < now() - ".$vt." and user = '$user' ";
        mysql_query($sql);




        where:
        USER_TABLE - your table
        POINTS - row points
        $p = '50'; - 50 points
        time - last login
        now(); - real time
        $vt = "86400"; - 24H
        etc...

        if you still want to award points for each login you can attach the example below just below the login script with you.

        $update = "UPDATE 'USER_TABLE' SET `points`=points+$p WHERE user ='$user'";
        mysql_query($update);

        repeat the procedure to log out
        http://ngeo.ro

        Comment

        Working...
        X