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 6062589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:04:10+00:00 2026-05-23T09:04:10+00:00

I currently have a website built in PHP, I’m hoping to build a referral

  • 0

I currently have a website built in PHP, I’m hoping to build a referral system tonight.

My theory is that if I dynamically generate a url and place it on my users’ homepage such as

“Referral url = http://www.mysite.co.uk/referral.php?user=myuser”

Then I could have a script in the page referral.php which gets the username and runs an sql query updating their corresponding row in my table.

The only thing is anybody could then add there own name and sign up multiple accounts.

What is the best way to go about building something like this?

Thanks


Suppose to get the referral url my users had to click a button which generates the referral url as a rand ie mysite.com/refer.php?user=234234, at the same time storing it in a the db.

Once somebody visits the page refer.php, the referrer then gets his credits or benefit added to his row in the db, at the same time setting his referral code to 0, making the code only available once.

Each time he hits the button on his page, his referal code would change.

Would this be valid do you think?

  • 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-23T09:04:11+00:00Added an answer on May 23, 2026 at 9:04 am

    You generally have the right idea, but protecting against fraud in a referral system is difficult. You can check for unique IP addresses in $_SERVER and add that to the database for each request, throwing away duplicates or limiting referrals from IP addresses that don’t come from the user who signed up. Like HTTP_REFERRER, this can be spoofed as well with ease (using TOR for example).

    It’s a tough problem that isn’t something you can truly “solve.” Like most fraud cases, you can only do your best to mitigate the effect.

    EDIT TO ADD: You can also require referrals to “mature” by forcing the referred user to be active on the site for a defined period of time (say, 30 days) to increase the effort of spammers/cheaters. But again, this doesn’t “solve” the problem – all you can do is make it tougher for them to game the system. And occasionally, by doing this stuff, you can ruin user experience. So how do you balance it? Tough question. 🙂

    EDIT TO ADDRESS YOUR EDIT: Contemplate the following scenarios if we implement your plan:

    1) I click the button and get my code. Then I paste it to… who exactly? One person? That’s not particularly good for sharing on Facebook, MySpace (does this exist?), or my personal blog. I have to generate a referral code for EVERY person I send to the site? That not only scales terribly, but is a horrible user experience as well.

    2) Let’s say I figure out what you’re doing. I develop a bot that clicks that button 4 trillion times. What now?

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

Sidebar

Related Questions

I currently have a news website setup in PHP/MYSQL that's a bit old and
I have .NET website that is mainly built for desktop browsers but I'm currently
I currently have a website that I am trying to optimize in terms of
We currently have a tool on our website that is created by JavaScript. The
I have a website that I'm making that needs a background resizer. Currently, I
Currently I have a url like this http://<client_name>.website.com/index.php?function_name&cat=32 I want to set things up
I have a website that I built on the CodeIgniter framework. It implements the
I'm managing a website that is built from the ground-up in PHP and uses
I have set up a company intranet website built with PHP/MySQL and allow users
I am currently encountering a problem with PHP and jQuery. I have build a

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.