1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Any easy script to mask affiliate links?

Discussion in 'Link Development' started by DomainMagnate, Jun 24, 2006.

  1. #1
    Hey, I'm looking for some script to mask affiliate links, so that if the links is sponsorsite.com/?affid=46463532, it'll be mysite.com/maskingscript.php?ego6o5=454age56regearar45gg or something like this :)

    please let me know where i can find a similar script.. :rolleyes:
    SEMrush
     
    DomainMagnate, Jun 24, 2006 IP
    SEMrush
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hmm... i don't see how this will work. you can mask the url all you like but the url will not work as the target server only understands the url in the un-masked format...
     
    daboss, Jun 24, 2006 IP
  3. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,929
    Likes Received:
    1,021
    Best Answers:
    0
    Trophy Points:
    455
    #3
    yeah, the idea is not to show the visitor the real link.
     
    DomainMagnate, Jun 24, 2006 IP
  4. [*-AnOnYmOuS-*]

    [*-AnOnYmOuS-*] Active Member

    Messages:
    254
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #4
    LOL that is an easy php code. I wrote this on the run for you.

    Points you need to know:
    the $_POST['ego6o5'] content is encrypted lets say.. Showing how u have made that seem as complicated as ever..
    Changing that value is very unnecessary.

    //Now to the code
    #makingscript.php
    if(!isset( $_POST['ego6o5'])):
    echo "bothing to redirect to";
    else:
    /* Now we have a value */
    //decrypt the value
    //this code might seem kinda lame..
    //but..
    //now use a $redirectto[# of encrypted value]='url of script affiliate';
    $redirectto[454age56regearar45gg]='sponsorsite.com/?affid=46463532';
    //for example
    //don't hesitate to add more than one
    /*now get the code from the array */
    $number=intval($_POST['ego6o5']);
    $redirecturl=$redirectto[$number];
    echo "<meta http-equiv='refresh' content='1;url=".$redirecturl."'>";
    //EOH

    /* I gotta go now.. Has many errors.. If you need any help just POST! :p
     
    [*-AnOnYmOuS-*], Jun 24, 2006 IP
  5. DXL

    DXL Peon

    Messages:
    380
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I found out this works some days ago:

    <a href="http://www.google.com/" onclick="document.location.href = 'http://www.yahoo.com/'; return false;">Go to Google.com</a>

    A better way is to use regular anchors (pointing at your affiliate links) and then let another JavaScript rewrite these to this code, so that non-JS users still get the actual links.
     
    DXL, Jun 24, 2006 IP
  6. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,929
    Likes Received:
    1,021
    Best Answers:
    0
    Trophy Points:
    455
    #6
    ok I've found a script somewhere.. thanks everyone for tips :)
     
    DomainMagnate, Jun 24, 2006 IP
  7. bloodwrath

    bloodwrath Active Member

    Messages:
    1,364
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    90
    #7
    bloodwrath, Jun 25, 2006 IP
  8. Ocean Dancer

    Ocean Dancer Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Michael, could you share the script!
    Ihave been going in circles trying to make a few pages's url seamsless on my site = ie not showing the subcontractor's pages in the browser window when someone is in my site.
    Thanks,
    C.
     
    Ocean Dancer, Jul 3, 2006 IP
  9. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,929
    Likes Received:
    1,021
    Best Answers:
    0
    Trophy Points:
    455
    #9
    I don't remember where I've found it, but here's a php code, copy and save it to links.php (or another name with .php at the end)

    <?PHP
    
    if ($o == "l1") {$link = "http://www.google.com";} // Default link
    if ($o == "l2") {$link = "http://www.yahoo.com";}
    if ($o == "l3") {$link = "http://forums.digitalpoint.com";}
    if ($o == "l4") {$link = "http://blog.findinforums.com";}
    
    header("Location: $link"); // Jump to the hiddden affiliate URL above
    exit();
    ?>
    PHP:

    upload links.php to your site's directory and then you can link from your html page to links.php?o=l3 to go to your favourite forums :)

     
    DomainMagnate, Jul 3, 2006 IP
    ameyjah likes this.
  10. Bondat

    Bondat Peon

    Messages:
    2,398
    Likes Received:
    217
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks for the script Michael.I was looking for this script also.
     
    Bondat, Jul 3, 2006 IP
  11. atomique

    atomique Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Great stuff Goldman.

    Worked like a charm.

    Thanks !
     
    atomique, Nov 30, 2006 IP
  12. JoelJonathan

    JoelJonathan Peon

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    hmm I get the error message: "Warning: Cannot modify header information - headers already sent by"
     
    JoelJonathan, Dec 15, 2006 IP
  13. DXL

    DXL Peon

    Messages:
    380
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #13
    @JJ - Make sure your .php file starts immediately with <?PHP, even a space will make it fail.
     
    DXL, Dec 16, 2006 IP
  14. SLM-why

    SLM-why Well-Known Member

    Messages:
    950
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    185
    #14
    You can easily do that by .htaccess
     
    SLM-why, Dec 16, 2006 IP
  15. smartgirl

    smartgirl Peon

    Messages:
    513
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Don't know if it's what you want but here's what i use :

    <a href="http://www.youraffiliatelink.com" target = _new onMouseOver="window.status='http://sponsorsite.com'; return true" onMouseOut="window.status=''; return true"> anchor text</a>

    On mouse over it shows the link as beeing a direct link to sponsorsite.com .
     
    smartgirl, Dec 16, 2006 IP
  16. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,929
    Likes Received:
    1,021
    Best Answers:
    0
    Trophy Points:
    455
    #16
    smartgirl, that will only work in IE and people can still see the link while clicking it ;)
     
    DomainMagnate, Dec 16, 2006 IP
    bnts likes this.
  17. smartgirl

    smartgirl Peon

    Messages:
    513
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Yeap, you're right :p
     
    smartgirl, Dec 16, 2006 IP
  18. JoelJonathan

    JoelJonathan Peon

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    I usually us .htaccess to mask a straightforward text affiliate link but I think my problem is because I am trying to use this php strategy to mask a more involved affiliate link that has a form and posts data (insurance affiliate offer with a quote box on my page where the lead inputs their zip code and then once the submit button is clicked then it directs to the other site to complete the quote) - In this thread I just posted what I am trying to do - it seems like I am throwing myself off somehow - any ideas?
     
    JoelJonathan, Dec 16, 2006 IP
  19. netnow22

    netnow22 Peon

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #19
    netnow22, Dec 17, 2006 IP
  20. NewIQ

    NewIQ Peon

    Messages:
    165
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #20
    ~~~~~~~~~~~~~~

    Hey All -

    My PHP skills are lacking, could someone please show what the code would look like if my affiliate URL was:

    http://affiliatelink.com

    and I wanted it to show:

    http://companyurl.com

    That would be really helpful, thanks!

    `
     
    NewIQ, Oct 5, 2007 IP