View Full Version : How to add a referrer system in current system?

12-16-2010, 11:18 AM
I have a website with simple signup sytem using php web pages and mysql database.
I add a line in current signup php page to include reffer member like:
referred by: ?

Now i want this:
When visitor enter a name in "referred by" field then system checks whether that name is present in db or not. If name is present then add 1 value in profile of that user who referred this visitor.

User profile should look like this:
No. of referrals: 1 (number of member joined bring by you)

Should i need to create a new field for this, like "referrer" in users table? if yes then how?

12-16-2010, 03:33 PM
I would create a new table to store who did the referring, who was referred, and the date/time of the referral. Then do a count() on the table whenever the number of referrals is needed for display or whatever.

If you store only a number and increment that number, there's a chance someone will figure out how to exploit the system and increment the number (perhaps by repeatedly submitting the signup form? who knows) and that kind of exploit would be easily spotted and corrected if you had all referrals stored in a separate table. Just storing a number would be much more difficult to correct.

12-16-2010, 08:45 PM
Please tell me step by step, what u will like to do to add referrer system securely.
Displaying no. of people bring by user will be ok and displaying all usernames of people bring by user in his profile will be more helpfull

12-16-2010, 11:16 PM
Um.. ok...

Step 1. Create referral table
Step 2. Use it

Hope that was helpful?

12-16-2010, 11:22 PM
I love how people come on here practically wanting others to do the coding for them.

We are willing to help you WITH your code, not WRITE it for you.

And it's not hard to search google either, maybe you should look into it.

And my first result:

Now come back when you have a question about the coding. How else do you expect to learn? Learn by doing..

12-17-2010, 10:12 AM
i am not asking for the affiliate system. I just want simple referrer system.
No body knows how to do that?

12-17-2010, 08:15 PM
i am not asking for the affiliate system. I just want simple referrer system.
No body knows how to do that?

It's PHP and probably under a license where you can modify it however you want, the reason i gave you that links is because you download the file and LEARN from it to create your own.

I commonly use 3-4 scripts if i can find them and create my own version from learning how they did it with theirs.

That way when you have a question how to do something, just go to that script or scripts and see how they do it, experiment with it and find a solution that works for you.

12-17-2010, 09:58 PM
I forgot to tell that i dont know about php. I just buy software and installed it but problem is it do not hv referer system. Thats why i am asking for help here.

12-18-2010, 09:29 AM
couple things, first be aware of free, free is not always free, sometimes there are hidden back links, open security holes allowing for injection, i even found several that tried to disguise their remote sending of my db information to thier email address on a monthly basis, so just be carefull with free, there are some open source that are good that people actually take the time to do it right and with respect for others, but just be careful is all.

On another note i have been working on an aff program for several months now designed for the small business and plan to release it this month sometime, its secure and very affordable, i didnt want to rip people off i just wanted to make sure there was something on the market that was respectable and honest for a decent price.. just fyi.. im not gonna mention the name of the software out of respect for this forum, i dont want to solicit here, i want to make it on my own merrit. Just wanted to mention it as an option for you..

12-18-2010, 11:54 AM
ok, is there any simple code so that i can track referrers?