Jump to content

Affiliates link


Gears

Recommended Posts

Why would you want to do that?

So the Affiliate can link to a certain page (not just the homepage).

 

 

MACscr, thanks. Think it would be possible to redirect according to what the incoming URL is? For instance, if the incoming URL ended in aff=002 then it would redirect to page1.html, but if the incoming URL ended in aff=005 then it would redirect to page2.html.

 

I have little/no experience with JavaScript. I'll do some Googling for JavaScript redirects.

 

Any other suggestions or comments are welcomed. Thanks again MACscr

Link to comment
Share on other sites

  • WHMCS CEO

Yes, the * page can go wherever you want it to. The * file is unencoded so that you can edit it and change the redirect or set it so that specific affiliates are redirected to different locations than others.

 

Matt

Link to comment
Share on other sites

  • 5 years later...

Hye Can you guide where and what to edit in the * file. I have pasted all links for affiliates however when required banner is clicked it shows 404 error with the following * script.

<?php

/**

* Affiliate Cookie Tracking + Redirection Handler

*

* @package    WHMCS

* @author     WHMCS Limited <development@whmcs.com>

* @copyright  Copyright (c) WHMCS Limited 2005-2013

* @license    [url]http://www.whmcs.com/license/[/url] WHMCS Eula

* @version    $Id$

* @link       [url]http://www.whmcs.com/[/url]

*/



define("CLIENTAREA",true);



require("init.php");



// if affiliate id is present, update visitor count & set cookie

if ($aff = $whmcs->get_req_var('aff')) {

update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$aff));

   WHMCS_Cookie::set('AffiliateID',$aff,'3m');

}



// if product id passed in, redirect to order form

if ($pid = $whmcs->get_req_var('pid')) redir("a=add&pid=".(int)$pid,"cart.php");



// if product group id passed in, redirect to product group

if ($gid = $whmcs->get_req_var('gid')) redir("gid=".(int)$gid,"cart.php");



// if register = true, redirect to registration form

if ($whmcs->get_req_var('register')) redir("","register.php");



// if gocart = true, redirect to cart with request params

if ($whmcs->get_req_var('gocart')) {

   $reqvars = '';

   foreach ($_GET AS $k=>$v) $reqvars .= $k.'='.urlencode($v).'&';

   redir($reqvars,"cart.php");

}



// perform redirect

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

header("Location: ".$whmcs->get_config('Domain'),true,301);

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