Jump to content

direct affiliate linking


panacheweb

Recommended Posts

at the moment the affiliate link only works with * and goes to the main page.

 

I am wondering how much more coding or transfer of code it would be to add that info into the order.php page..

 

OR..

 

have the abiltiy for * to have a direct link to items that have an affiliate price in them.

 

example. domain.com/whmcs/*?aff=001&step=2&pid=1

 

where the info from step=2&pid=1 gets transfered over to the order form.

 

how much more coding would this be to do this?

 

MJ

Link to comment
Share on other sites

ok here is the code as I have coded it, although I would love to see Matt add this into this next release:

 

<?php

define("CLIENTAREA",true);

include("dbconnect.php");
include("includes/functions.php");

if (isset($_GET["aff"])) {
$aff = $_GET["aff"];
$step = $_GET["step"];
$pid = $_GET["pid"];
$gid = $_GET["gid"];
$aff = sanitize($aff);
$query = "UPDATE tblaffiliates SET visitors=visitors+1 WHERE id='$aff'";
$result=mysql_query($query);
setcookie("WHMCSAffiliateID", $aff, time()+90*60*24*30);
}

header("HTTP/1.1 301 Moved Permanently");

if ($_GET["aff"] == NULL) {
header("Location: ".$CONFIG["Domain"]."/order".".php");
} elseif ($_GET["step"] == 2) {
header("Location: ".$CONFIG["Domain"]."/order".".php"."?step=$step&pid=$pid");
} elseif ($_GET["gid"] == $gid){
header("Location: ".$CONFIG["Domain"]."/order".".php"."?gid=$gid");
} else {
header("Location: ".$CONFIG["Domain"]."/order".".php");
}

?>

 

hope this works for all of you, as this is what I needed for my website and affiliate program for how I was going to design it.

 

MJ

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated