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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:20:10+00:00 2026-05-25T02:20:10+00:00

I am presently working on building an user referral tracking script in PHP ,

  • 0

I am presently working on building an user referral tracking script in PHP , MySql . As per the plan , any user who completes the registration will be given a referral link as well as he can share info about my application on Facebook and Twitter .

Now , untill and unless this user brings at least 5 more users to my site , he won;t be allowed to view the home page .

Now , how can I track the number of referred persons that this user brings ?

1.If I use $_HTTP_REFERRER – In this case I can get the link from where the user has landed onto my page . If this is my referral link then I can update the database entry for this user , and the number of referred persons + 1. But , how reliable is $_HTTP_REFERRER ?

2.If I use to track through cookie : Here I am a bit confused as to whether I have to set the cookies for each and every browser or is there any browser independent cookie setting method ? During setting the cookie , how I should save it , I mean should I use only referral id or should I use a combination of referral id and site_id(or any other rcombination).

Also , I should save the referral info in a database . What should be the ideal table schema for this table . I have planned something like :
(user_id,user_name,no_of_referrals,referred_by).

  • 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-25T02:20:10+00:00Added an answer on May 25, 2026 at 2:20 am

    To get the referer, you want to use $_SERVER['HTTP_REFERER']. Nearly all browsers will send a referer, but it isn’t mandatory that they do. Since this is a client-side thing, it can be easily modified by the user.

    Most sites I’ve seen that use things like this use a variable in the URL to track the originating site. Something like this:

    http://www.yoursite.com/someresource?originaccount=12345678

    Whether or not this works for you is highly dependent on what you intend to do with that information, as obviously someone could change the ID as well.

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

Sidebar

Related Questions

We are presently working for a client who is new to working with distributed
Hello I have been working for a while with PHP and MySQL. Now I
I am presently working on converting a 32-bit application into a 64-bit application in
I am a RoR developer, but I am presently working with CakePHP for a
Presently, I'm thoroughly dissatisfied by the command-line program /usr/bin/mysql! It does not, e.g., let
I have a MySQL database of keywords that are presently mixed-case. However, I want
I'm presently working with data in text files. I need to use algorithm called
I'm presently working on a large intranet mashup that uses sharepoint to aggregate content
am new to coding in javascript and am presently working on a web page
Presently I'm working on a Windows Phone application that will work in both online

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.