Please help me with a simple code

by 2 replies
3
Hello, I'm using an online affiliate management software and when affiliates join my program they receive a link similar to the the one below to promote my product.

http//mysite.com?oid=affiliateid

When the affiliate sends a visitor using their affiliate link, is there any simple code that I can set to have the next page they visit on my site grab the affiliateid from the affiliate url and attach it to the end of the next page url?

I hope that I've been able to explain this clear so that someone can help me with this. Thanks!
#programming #code #simple
  • You try something like this:

    <?php
    //This goes on top of your page
    $oid = $_GET['oid'];

    // Then you can create a link like this:

    $new_link = '<a href="http://www.yourdomain.com/page?oid='.$oid.' >Link Text</a>';



    ?>Then where ever you want to place the new link just add
    <?php echo $new_link; ?>

    Note to moderator: I tried wrapping the code but the page just kept going blank
  • I would use cookies or session objects to track the referral through the duration of the visit..

Next Topics on Trending Feed