How to make a referral system in PHP. How to make a referral system in PHP Creating your own group

37.4K

The Internet is a wonderful place! Here it is possible that in reality even the most talented science fiction writer would not come to mind. Take at least ways to make money on the World Wide Web. Well, where is it seen to make money on the html tag? That is, they gave you a link, and as you want, so “cool” with it. If you haven't figured it out yet, this is about how to make a referral link and use it effectively:

What is a referral link

As you may have guessed, links are regular and referral. They have a lot in common, but there is one main difference: no one will pay you for clicking on a regular link. And if you “persuade” the user to go through the referral, then a certain monetary reward is expected for this. But first things first.

A referral link is the main means of obtaining "daily bread" for any referral. It is an integral part of most affiliate programs deployed on the Internet. Of course, any affiliate program can do without referral services, but then its effectiveness is greatly reduced.

Referral programs are one of the varieties of affiliate programs. But unlike regular affiliate programs, referral is the means of active advertising in referral. It is he who "forces" other users to visit and register on a partner site. Affiliate site means a resource that is the goal of the referral program. That is, to which the referral attracts new users.

You can learn more about how to attract referrals by link from our dedicated to this topic.

It is clear that the referral does not just “drive” visitors to the site. For each new user who came to the target resource and passed the registration procedure, the referral receives a certain reward.

As a resultant action of the user, for which the referral is rewarded, not only registration can act. It can be reading mailing lists, downloading content, and much more.

But the referral is not all the same through which link the user gets to the partner site. It is important for him that a new user comes to the resource by clicking on his referral link. Her referral is provided by an online service that organized and runs an affiliate program. You can read about how such an affiliate program works and how to advertise a referral link.

Referral link structure

The figure shows an example of a real referral link. As you can see, it is almost no different from the usual. Also, the "piece" that comes right after the question mark. In this part, a unique identifier is written, which is assigned to the referral by the affiliate system at the time of registration.

For the very curious, we will tell you that in web programming this part of the link is called the parameter line. Through it, using the Get method of the http protocol between resources ( or between site and server) there is a transfer of variable values ​​that are most often set ( are initialized) via web form fields.

That is, in order to understand how to create a referral link, you need to understand that the unique identifier transmitted with its help is a variable. After clicking on the referral link, its value is passed to a special function for further processing ( referral rewards).

This is how you can briefly describe the mechanism of functioning of a regular referral program. A referral link can be easily confused with a regular one. After all, the mechanism for passing variables described above is generally accepted on the Internet. But there is one main difference.

The unique identifier written in the referral link most often has a meaningful meaning and consists of only letters. It is in many ways similar to a user nickname.

The referral ID is registered by him when registering on the affiliate site. That is, the referral link is " nominal ".

How to create a referral link?

It is impossible to answer this question unambiguously. Since the referral link itself is nothing more than a regular html tag with the value of the variables passed through it. But to create a mechanism for processing identifiers, you need good knowledge of web programming. Therefore, a separate article will be required to describe its implementation. So let's better find out how you can remake the referral link.

It's very simple! You need to enter the desired one instead of the specified identifier. For example, if your referral nickname is "Zevs", then the converted link code will look like this:

http://www.rotaban.ru/?a= Zevs

But what if you are the owner of the site, and to promote it you need to organize your own referral program. For this, web programmers have already created special plugins.

One of the extensions with which you can both distribute referral links and create them is the AlphaUserPoints plugin. It is designed for Joomla CMS. On the developer site alphaplug.com, you can download the required edition of the component ( depending on engine version):


This extension allows:
  • Organize lotteries among referrals;
  • Set start and end dates for affiliate programs;
  • View statistics for each participant;
  • Organize a ranking system of referrals;
  • Edit the list of participants in the referral program;
  • Organize a separate account for each participant of the referral program:
Within the framework of this article, we will not touch on the topic,. The next section is about hiding such links.

Hide referral link

It would seem that there is such a terrible thing if you go not through a regular link, but through a referral one. But it's human nature to be afraid of the unknown. Moreover, this phobia is no longer characteristic of ordinary users, but advanced ones.

People are afraid that:

  • They will earn money;
  • They will become referrals and information about them (and their purchases) will be known to other people;
  • One way or another, they are deceived.

Therefore, it is better to play it safe once again. Here are the main ways to hide a referral link:

  • Use the title attribute - in html, it sets the text of the tooltip that appears when you hover over the element with the mouse cursor. This can be used to divert the user's attention from the true address of the link, which is displayed in browsers when hovering over it in the lower left corner. Changed link code:

Good hyperlink

In this article, I am going to tell, how to make a referral system in php, she is affiliate program. Let's say you want to somehow reward those users who bring you new ones. And I'll try to tell How is such a system of referrals done in PHP, and I immediately inform you that there will be no ready-made code here. Ready-made code on other sites, but here I talk about the solution algorithm, but you should be able to write it.

First of all, you need to understand how to track who the user came from. Everything is quite transparent here, and you just need to generate a link for each partner. For example, in this form: http://mysite.ru/?ref=abc, or http://mysite.ru/page.php?n=5&ref=abc. That is, the main thing is to be GET parameter ref, and the value of this parameter is the login of the user who brought this visitor.

Next, you need to save information from this new visitor about who brought him. You need to save it in cookie. And then you need to see if this new user will perform the target action. For example, if he buys something, then add money to the partner’s account, and also fix e-mail this client for a partner. Then if the client buys something else, the partner will again receive a commission.

If the target action is, for example, registration, then it is necessary to add the field " ref", in which to indicate partner id.

Now as regards multilevel affiliate programs. In this case, it is necessary to make the field " ref and write there partner id who brought this new partner. If he himself came, then put " 0 ".

Let me summarize how to make a referral system in php:

  1. Provide a link to partners of the form: any_site_page?ref=partner_login
  2. Every time you visit the site, check for ref, and if it exists, then add it to cookie user partner id from which he came.
  3. When performing a target action (registration, subscription, purchase, and so on), take the value partner id from cookie and add this information to a table (with users, subscribers, orders, and so on).
  4. If, after the completion of the target action, there should be an accrual, for example, commissions, then do this.
  5. If the affiliate program is multi-level, be sure to add the field " ref" in the table with partners.

As you can see, everything is quite real, but I immediately say if PHP and MySQL if you don't know, you can't even try make an affiliate program in PHP. For those who are familiar with them, there should be no difficulties.

Hello dear readers! This review is for those who want to make a profit not only from their own work, but also from the work of other users whom you introduce to the affiliate program. Let's talk about referral projects.

The referral system is one of the most common marketing techniques today for the rapid promotion of services of various types and content. Its essence is to attract to a sponsorship project as many new active users as possible. People who are engaged in the introduction of such users and receive money for this are called referees. Next, we will consider in detail the features of this type of earnings. But first, let's find out: what is a referral link?

What is a referral link?

Referral- this is a link, the transition of users on which brings profit to its creator, that is, the referrer. The referral has an element that identifies the person to whom it is assigned. When users follow a hyperlink, perform certain procedures there (create their accounts, download something, buy something), they automatically become referrals and their activity brings fixed income referee.

There are two types of referrals:

    1. Direct referrals name those users who registered directly by clicking on the link with your code;
    2. Indirect referrals- those users who registered using your referral link.

If you are actively involved in the distribution and promotion of your referral for a long time, then after a while you will be able to create net participants from direct and indirect referrals. This network can be a good source for your constant passive income. But for the activity of users, they need to be stimulated and supported in every possible way.

Referral link examples

An ordinary user is unlikely to be able to distinguish a reflink from a simple one. If only he knows what a referral link is and keeps a very close eye on his surfing the internet, then he will be able to identify it.

Each ref contains the identifier of the user to whom it is assigned. It is thanks to a special code that the program calculates the number of operations for each specific address and calculates the profit for the referee. What is a referral code? This is individual for each new account a combination of numbers and letters that is used to identify a person creating their own referral network.

Examples of links with codes assigned by the system:

https://www.tinkoff.ru/sl/2fGaXeTi08y

http://hideme.ru/vpn/#57b0465342091

The code may include the referrer's personal login. For example: https://www.okpay.com/?rbp=guideinvestor .

The component that distinguishes this "named" link from the usual ones is located after the question mark. It is there, in the parameter line, that the identifier is written.

Referral code, or invite code, allows you to receive and accumulate cash and bonuses. The referral code is a variable, the value of which, using special program transferred for profit accrual. The size of the specified value directly depends on the number of transitions.

What are referrals for?

They are used as part of an affiliate program on various sites and services. The main purpose of using referrals- involvement of participants in the project. This is exactly what the activities of companies with a referral and affiliate earnings program are aimed at. The list of services that usually use an affiliate program with such a system is presented below.

In the market of Internet goods and services, there is a large competition. Therefore, site owners are willing to pay those who provide them with new customers. So why not make money on it?

What do you need to participate in the referral program?

It is very easy to start earning in this way. First of all, you need to choose . Followed by register in the affiliate program, create your own Personal Area and get into the system of the site. Among the sections of the cabinet you need to find the item " Promotional materials" (it can also be called " Partners», « Agents»).
At this point, you need to copy the reflink that the system will generate for you. After that, you just have to publish it on promising sites for earning and get your money. The list of sites where you can place a referral is indicated in this article.

The more people who use your referral link, the more profit you can make. Necessary actively share your link wherever possible. For example, a great platform for this could be social networks. Thus, this article will be useful to those who are interested, or on the pages of other popular communication sites.

How to make your referral work for free?

Having a referral does not guarantee you a big income. In order for it to work and bring in money, the address must be placed on the Internet pages viewed and actively advertised. This can be done without spending additional money. Where is the best place to place a referral link for free?

Where to publish a referral link to attract more referrals?

Your work will be much more productive if you use referrals to promote paid specialized sites. Ordering advertising involves cooperation with projects in which refs are distributed by mailing letters and assignments. Pay attention to such programs: vipip, Socpublic and Wmmail.

The main place to advertise referral (affiliate) products are social networks. To increase traffic and subscription base, you need to create and promote, for example, your own public vkontakte, profile instagram, youtube-channel. Below I will indicate the services with which you can promote your site and attract potential referrals.

For beginners at the start, it is best to use cheap services for cheating a subscriber base or drawing attention to your posts with the help of likes and reposts on VK, Instagram or filmed video on the youtube channel, the so-called SAR. List of advertising exchanges to work in in social networks from the cheapest to the most expensive and high quality:

  • Vktarget ;
  • likes rock ;
  • vkserfing ;
  • profi-like ;
  • Socelin .

For a detailed overview of the last service on the list and how to work with it, read.

The next step is to manually free promotion of your page, profile on Instagram. Recruit an interested audience using a program (software) for cheating subscribers. We create 5-10 accounts, decorate them deliciously, put cool avatars, make 3-5 posts on the topic of the advertised product and useful information about it. We collect the target audience from the VK publics of interest using services VKParser or pepper.ninja .

Affiliates with referral systems

Affiliate programs involve active cooperation of a large group of people to increase the profits of a particular project. The referral system is actively used by the following companies:

  • CPA affiliate programs(Cost Per Action - payment for actions);
  • teaser networks– affiliate programs that manipulate teaser traffic (sale, purchase, exchange);
  • Software manufacturers;
  • SEO services and SaaS products for webmasters and optimizers(Key Collector, Аdvego.ru);
  • Gambling(online gambling);
  • travel agencies(tickets, booking);
  • Forex market and binary options;
  • Affiliates who are engaged in advertising in video;
  • Adult(earnings on "sites for adults");
  • Pharmaceutical companies;
  • Services that distribute souvenirs and gifts;
  • infobusiness;
  • Exchanges for cooperation with freelancers, copywriters and rewriters.

Concept attracting new members to the system for a reward already long gone beyond online business. Today, many non-Internet businesses are using this partnership scheme to expand.

Software for cheating subscribers

  • robot ;
  • VKAccountsManager ;
  • botsapp .

The current top choice is BroBOT. Detailed overview with examples and instructions - . In addition, be sure to read mine.

After you have promoted your VK page to 200-500 friends or increased the number subscribers before 2000—5000 , it's time to attract organic and interested traffic to the site or page through advertising in other communities. To do this, you need to use advertising exchanges. Two the best, not related to the more expensive official exchange VK - Sociate and Plibber .

Advertising platforms, teaser banners

Another of the oldest methods for quick referral promotion is still alive. When working with services that provide advertising platforms and teaser banners, you can specify the desired ad format and the region in which it will be distributed. The best services of this type:

  • teaser ;
  • jobplant ;
  • postingblues .

This option of expanding your referral network is quite expensive and often not effective for beginners. You can place a couple of test ads, and if they pay off your advertising budget and make a profit, you can raise your bids. Some services offer systems discounts. Therefore, I always advise read the conditions carefully cooperation.

Why not remove the referral link?

Once you've started on a specific project, you'll need time to get into it. The referee will help you navigate in detail, suggest options for increasing labor productivity, answer questions that have arisen. You can consider the referee as a kind of curator in the project.
Of course you want get as much money from the project as possible. The referee is also interested in your activity and high income. That is why he will try to help you earn more.

In many projects, there is a pleasant tradition: referrals encourage users assigned to them for active work. Often, referrals arrange contests and competitions, for the victory in which a cash prize is also due.

It is not recommended to remove the referral link, if only because, by leaving it, you thank your referee for help in adapting to the conditions of the project. In addition, sometime you will have to think,. Believe me, then you will It's very nice to see that no one deletes your links.

How to protect a referral?

  • if they want users who are afraid of referral systems to go through it;
  • when they want to protect the link from unscrupulous users who can cut it or fix the individual identifier in their own way.

Exists several ways to protect your referral:

  1. You can do this by redirecting through the PHP file. It is necessary to create a PHP file in which to register the link as follows:

    header("Location:$URL");

    Instead of URL, you should specify the address of the required reflink. Save the entry in a text editor like notepad and upload the file to the root folder of your site using the program FileZilla. After the done manipulations, your link will look like this: http://site_address/okpay.php.
  2. The second option is redirect via html file. Create an HTML file in Notepad with the following entry:

mob_info