How to make a Refferal System? HELP!

Started on the old forum in July 2012 · view the original in the archive · old links redirect here

6 replies · 688 views · started 14 years ago · 1 min read

4 participants
mufasya Junior · 28 posts #1

Plis anyone help here and give me a example code script to create some link like this "/reg.php?refid=1,2,3,,,etc" I hope someone else here can help me! This my first code snippet but is not working, how to fix this?

if (isset($_GET['refid']))
{
$refid = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
mysql_query("UPDATE `user` SET `idr` = '".($user['idr']+100)."' WHERE `id` = '$user[id]' LIMIT 1");
}
mufasya Junior · 28 posts #3

What are u mean friend?, please can u explain me more detail, can u give me a some example refferal code script here?

Rksk Developer · 54 posts #4
  1. the bug of ur code is, u get query result to $refid. but u use $user in 2nd query.

  2. when u r using this code, if a visitor or ur user refreshed several times this url, what happen? ur user get more n more ref points? so use a cookie or a session record to name each visitor. then don't add ref points only for new visitors. if u r using this ref system for user registration site, just update ref points after registering a visitor.

*we can suggest u, but can't code for u friend.

mufasya Junior · 28 posts #6

Thank's my friend @Antonytx

nimeshka Developer · 180 posts #7

hai bro.....I have posted a script for this before..Search in my posts I'm sure u could find it.

or if I could find it, I will definetly post it here for you.

External image (may be gone)

I'm Proud to be a Sri Lankan!

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