point when you login on a site

Started on the old forum in October 2009 · view the original in the archive · old links redirect here

3 replies · 634 views · started 17 years ago · 1 min read

2 participants
brand Senior · 391 posts #1

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

External image (may be gone)

i only work on wapdesire v_2 coding only

blackhowk Senior · 411 posts #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.

brand Senior · 391 posts #3

blackhowk wrote: 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

External image (may be gone)

i only work on wapdesire v_2 coding only

blackhowk Senior · 411 posts #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

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close