How would I add the function to my existing script?

Hello All,

This is the second time I posted this topic as I was a guest before. So if there happens to be a dupe please disregard the guest post.

Now moving on to the task at hand. Currently I am working with a fully working KB Affiliate/Referral script. Everything is working just as planned but I would much like to add a new feature.

If for some reason you are unaware of a affiliate/referral system (hopefully unlikely) the process is the user is given a unique url link to share. When a new user comes along from a click through on their link they are awarded points in the DB. Simple right?

Okay my site plays host to two main user groups.

Pros

Biz

The Biz group start campaigns and the Pros promote that campaign for them. I would like to add another unique id to the referral link to identify which campaign the referral link is assigned to.

So a Pro can promote for many different campaigns at the same time. The pros stats could look something like this.

Pro id : Twizix

Total Referrals: 260

Referrals for Twizix Designs: 60

Referrals for Stocket Co : 110

Referrals for My Company Ban: 90

I hope I have given you enough info to get my question across.

Well, not really enough info… First, this is a code help site, so some idea of how you current system work code-wise might help. But, in general, here is how those links most likely work currently.

The link is an HREF. Which means it points to somewhere on a server. Inside the HREF is some optional variables such as the referrer’s ID and what product they are pushing. A sample HREF would be something like:
Click here to be referred!
(Just a wild off the top of my head example since I can not see your code!)

Now, adding in some parameters or optional variables is easy. The link just has something like this in it:
Click here to be referred!
(This example has a referrer’s ID of 33 and product number of 12 in it.)

Then, in the referrers_page.php, you would retrieve this info using a $_GET() function. Something loosely like this:
$referrer=$_GET[‘ref_id’];
$productID=$_GET[‘prod’];
do something with this info here…

So, that is how easy it is to pass info thru your links. What you need to do is create new variables to load and pass to whatever the PHP code is that currently handles when someone clicks on the link.

That is just a start for you to go with. You need to look at the structure of the current links you are using and add in a new variable to handle what you want to add for data to pass. Then, in your code that handles when the link is pressed by a viewer, you will need to add it whatever you want to do with the new data.

Hope that helps… Good luck!

Sponsor our Newsletter | Privacy Policy | Terms of Service