Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Where can i get the script

General discussions related to php

Moderators: macek, egami, gesf

Where can i get the script

Postby gazingleo » Fri Jun 06, 2014 11:39 am

im looking for a script file that will supply unique links per member to share, with 3 options to chose from for joining a site. i want the links to track how many joining members join each members links and what option was chosen by the new member. i also want it to credit the member with a credit to the option chose by new member to join ,that shared the link and got the mew member to join via there unique link. i need an admin that will track all members there links and options chosen as well and what option they are running under.. Thanks for your help .. If you can point me in the right direction or a term for this function to look for would be great thanks
gazingleo
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Jun 06, 2014 11:36 am

Re: Where can i get the script

Postby donnagreenword » Mon Sep 01, 2014 7:21 pm

Check this out. It used to help me.
http://phpthisreview.weebly.com/
donnagreenword
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Sep 01, 2014 6:38 pm

Re: Where can i get the script

Postby freshnet » Sat Oct 18, 2014 5:24 pm

If you want to track the referrer, the best way to do this is via a GET, e.g.

Code: Select all
www.urltovisit.com&referrer=1
www.urltovisit.com&referrer=2
www.urltovisit.com&referrer=3


If your username is unique, you could do something like hashing the username and using that as the referrer. md5 isn't the best option security-wise, but just an idea. You could also just use the user id of the referrer (hashed or not)

Code: Select all
$salt = 'Q2348Z*W!!'; //salt to add a bit more security
$referrer = md5($username.$salt);

$link = 'www.urltovisit.com&referrer='.$referrer;



You can use php in the target page to get the referrer value and see how many people got there from that link. If you want to then credit the user, you'd have to go through all usernames and compare them to the hash:

Code: Select all
$key = $_GET['referrer'];
$salt = 'Q2348Z*W!!'; //salt to add a bit more security

foreach ($row as $user_row)
{
$hash = md5($username.$salt);

if ($hash==$key)
{
//update the database or whatever with the credit for the referral
}
}
User avatar
freshnet
php-forum Active User
php-forum Active User
 
Posts: 278
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.