Artichoke Games
02-12-2004, 10:04 AM
As our first game is almost finished, I've been trying to set up a php system that would track downloads from download sites. What I want to do is to set a cookie with referer, so I can read it when a sale takes place. The problem is that download sites require direct links to executables, so setting a cookie becomes a problem.
I've come up with two solutions:
1. In .htaccess I add a handler so that .exe files are processed as php scripts. The script, game.exe for example, sets a cookie with data that interests me and returns valid game executable by setting apropriate headers and using @readfile. This solution is quite good, the only problem I see now are download managers displaying info 'server does not support resuming'.
2. Second solution is much worse. In .htaccess I redirect .exe file to .php script which sets a cookie and uses meta refresh to serve the file. This method supports resuming, but has obvious drawbacks - visible redirection and "right click and save as" returning html file.
Have anyone found any acceptable way to track downloads from external sites? I've searched through these forums and found some related info, but it didn't answer my questions. I've also read about dynamic pad files, but this looks too complicated and I'd rather use the cookie solution.
Any tips? Thanks in advance! :)
I've come up with two solutions:
1. In .htaccess I add a handler so that .exe files are processed as php scripts. The script, game.exe for example, sets a cookie with data that interests me and returns valid game executable by setting apropriate headers and using @readfile. This solution is quite good, the only problem I see now are download managers displaying info 'server does not support resuming'.
2. Second solution is much worse. In .htaccess I redirect .exe file to .php script which sets a cookie and uses meta refresh to serve the file. This method supports resuming, but has obvious drawbacks - visible redirection and "right click and save as" returning html file.
Have anyone found any acceptable way to track downloads from external sites? I've searched through these forums and found some related info, but it didn't answer my questions. I've also read about dynamic pad files, but this looks too complicated and I'd rather use the cookie solution.
Any tips? Thanks in advance! :)