I want to make so that you can download a affiliate-link (exe-file) direct from a "download"-button... but the problem is that this company (who provide the affiliatelink) doesn't have a solution when it's about "download direct".

I saw on a site (http://www.pokerlistings.com/betfred-poker) that apperently had a solution which makes a comletly white page to come up, and then the file (exe-file) comes directly for download.

I thought this was very smart, but I have not a clue how it'll work? Someone that now, and have the script?

Hm... Since I'm not so good at PHP I don't really know what to look for.

Someone that have the full script?

There is no script. It's just one line of code.

Nobody that have a solution?

One line of code? How do you mean?

For the website to register it as a "download from me", it has to first connect to the affiliate adress ( http://banner.betfred.com/cgi-bin/redir.cgi?id=N&member=BlueLizard&profile=pmillion ), then to the download-adress ( http://banner.betfred.com/cgi-bin/SetupPoker.exe ).

That's the problem...

Someone that know how to do this?

What you are looking to do is set a cookie on the visitors computer that belongs to www.betfred.com. Only the site www.betfred.com can do this.

The cookie name is: banner_domainclick
The value for your affiliate url would be: BlueLizard,pm468x60,pmillion,http://www.daniweb.com/techtalkforums/post233015.html,*

Only the visitors computer can set this cookie for them and only when visiting betfred.com, so you cannot use PHP to set this cookie.

Also, JS cannot be used because the Domain restriction policies in setting cookies extend to JavaScript most any browser used on the web.

So your only choice is to use a hidden Iframe. This can set the cookie for you while the user is on your page. So when the user clicks on the download link, they already have your Affiliate Cookie on their computer.

When using this method, make sure it is within the terms and conditions of your affiliate membership. As you can see from the value of the cookie, BlueLizard,pm468x60,pmillion,http://www.daniweb.com/techtalkforums/post233015.html,*, it includes the referring page which the site is very likely to track.

If it goes against their terms, this could be worse off for you. You've been warned :)

You can write a java script to handle it by place the button within a form and having the form point to the script function. For example:

<Script language="Javascript">
function sendthis(f){
    var elm=f.elements['searchpedigree'];
    switch(elm.options[elm.selectedIndex].value){
        case 'search1':
            window.location='pageA.html';
            break;
        case 'search2':
            window.location='pageA.html';
            break;
    }
    return false;
}
</script>
<form onsubmit="return sendthis(this);" action="sendto.php">
 <select name="searchpedigree">
 <option value="search1" selected>Pedigrees</option> 
<!-- Need this to go to pageA.html -->
 <option value="search2">Shipments</option> 
<!-- Need this to go to pageB.html -->
 </select>
 <input type="submit">
</form>

Hope it helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.