Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6059365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:42:08+00:00 2026-05-23T08:42:08+00:00

I have a membership based website and im planning on implementing a referral system.

  • 0

I have a membership based website and im planning on implementing a referral system.
My website is credit based, the idea is that if User X refers User Y, then User X gets 100 bonus credits.

Has anybody built a referral system before and if so what obstacles should I bear in mind? I’ve had a snoop round SO tonight but couldn’t find any suitable answers.

My theory is to give each user a random string which is generated and stored in the DB when they sign up, The user will then be presented with a URL incl. that string which when they pass to somebody (User Z), User Z is then sent to a page, the page then uses the GET method to gather the Random string and update the DB Row they currently occupy, does this sound feasible or could it easily be breached?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:42:09+00:00Added an answer on May 23, 2026 at 8:42 am

    Typically this is called an affiliate program. You pretty much got it right in your description, but I would also store the referral from the $_GET var into a session or a cookie so the user can be credited even if they navigate away from the referral page.
    By this I mean – typically an affiliate program credits user X only if user Y registers or buys something. So user Y can hit the referral page, then look around, then find their way back to a registration page, or purchase page. By that point the referral $_GET var is lost and so is the credit. So your referral page would store the session or cookie for the referral code, and your registration page or checkout callback would check for these vars and act accordingly.
    I believe scott’s method is good if there is concern like he mentions, but alternatively you might want the referral to stay static all the time, for cases like business referrals that people might put on business cards. They do that a lot in MLM where the reps are given profiles on a central company website so they don’t need to make their own.

    I don’t know what you mean by update the DB row they currently occupy. Are you suggesting something like a count field that holds a number representing the total referrals? If so, I would say that’s not a good idea. You should record each successful referral as its own entry in a relational table with the referrer’s id as the common key. That way you can store all kinds of post data in the referral so you know if you’re being messed with. Like, say, a user making 1,000 yahoo accounts and signing up with their own referral code just to get bonus credits. Your relational table might see the repeating IP address, or referral email being incremental (johndoe1000@yahoo.com, johndoe1001@yahoo.com, etc) and then you know to take action.

    The safety of your suggestion ultimately comes down to how you handle the data. If you blindly insert anything into the DB then everything is harmful. Just make sure to properly escape things and keep an eye on behavior, even manually. You should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I have a simple membership based website where users log in and
We have a number of Excel-based membership rosters for a non-profit organization and we
I have built a custom membership provider that I have used in a previous
I have to confess that I hate membership provider. The default implementation is not
I'm currently working on a membership system for my web application, which is based
I have a problem when trying to create a membership for users based on
I have a site using ASP.NET Membership and have a number of roles that
I have a rails app that tracks membership cardholders, and needs to report on
I am attempting to create new membership users in an Ektron CMS400.NET-based website by
I have an ASP.NET Role/Membership based forms authentication site. There's a subfolder and its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.