How to change Affiliate link dynamically

by 4 replies
5
Is there any plugin or script available to change the affiliate ID on a sales page dynamically.


Thanks
#programming #affiliate #change #dynamically #link
  • Anything on a page can be changed dynamically, but I would need to know more details to tell you what to do. For example... how is the link originally generated/displayed? And what do you want to change it to? etc etc.
  • Here is what I want :

    Example : http://mysite.com/salespage/?id=myaffiliateid

    At this page my affiliate link is like : http://xyz.com/join.php ?id=myaffiliateid

    When I replaced id with " anything" in my site url : http://mysite.com/salespage/?id=

    Then affiliate id change to : http://xyz.com/join.php ?id=

    Thanks
    • [1] reply
    • Whatever happens when you visit the xyz.com/join.php page would depend on the source code in that page. If that site is not controlled by you, then there's nothing you can do to change it. If that site is controlled by you, on the other hand, then I would need to seen the source code from the join.php page to tell you how to do what you want.
  • This is in http://mysite.com/salespage/index.php
    Code:
    <?php
    if($_GET['id']){
    $affiliate="?id=".$_GET['id'];
    $url = "http://xyz.com/join.php".$affiliate;
    $next = trim($url);   
    }
    else {
    $next = "http://xyz.com/join.php?id=myaffiliateid"
    }
    ?>
    
    <a href="<?=$next?>">Join Now</a>
    Have Fun
    Larry Keenan

Next Topics on Trending Feed