Re: [PHP] Affiliate system
On Wed, September 13, 2006 12:58 am, Peter Lauri wrote: What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. PHP's use transsid setting in php.ini does exactly that, only with the session ID, and you don't have to do nothing except turn it on. :-) Maybe I can also create a SESSION that stores the affiliate information so that it at least get registered if the purchase is completed within the session? Using PHP SESSION with the transsid on means you can have the session last reliably for up to 2 years, if you want to. That's what I would do, personally, and then you can simplify your code quite a bit... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Affiliate system
On Wed, 2006-09-13 at 12:58 +0700, Peter Lauri wrote: Hi guys, I am reviewing an affiliate system that I created a while ago. I am using a very simple method to do this, but I am curious if there is any better system (better I mean less missed affiliate purchases). 1. User click on affiliate link http://thedomain.com/?a=1234 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and then set a cookie for that 3. At purchase, we check if that cookie still is there, if so, we register it as a affiliate purchase and that info is stored in the purchase database What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. Maybe I can also create a SESSION that stores the affiliate information so that it at least get registered if the purchase is completed within the session? Sessions and temporary cookies solve the same issue (even if sessions are using trans sid). If a user has cookies disabled then you can rely on the trans sid feature which already performs the propagation of the session via URLs as you have suggested. Failing that, you don't really have any alternatives :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Affiliate system
use session. or you can store it in a database but that will take speed. :) using session is much better rather than using cookies for lots of reason (just google) specially if you are concered with security. just my 2cents. hth, john p.s. if the client cookies is disabled set to true the session.use_trans_id. On 9/13/06, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2006-09-13 at 12:58 +0700, Peter Lauri wrote: Hi guys, I am reviewing an affiliate system that I created a while ago. I am using a very simple method to do this, but I am curious if there is any better system (better I mean less missed affiliate purchases). 1. User click on affiliate link http://thedomain.com/?a=1234 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and then set a cookie for that 3. At purchase, we check if that cookie still is there, if so, we register it as a affiliate purchase and that info is stored in the purchase database What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. Maybe I can also create a SESSION that stores the affiliate information so that it at least get registered if the purchase is completed within the session? Sessions and temporary cookies solve the same issue (even if sessions are using trans sid). If a user has cookies disabled then you can rely on the trans sid feature which already performs the propagation of the session via URLs as you have suggested. Failing that, you don't really have any alternatives :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- GMail Rocks!!!
Re: [PHP] Affiliate system
I ran into same issue with a site... I solved this problem by saving information in 2 places (in cookies and in database). So when saving data once I saved in the cookie then into database. When I wanted to read the information I first check if cookie exist and if it doesn't I read from database. Andy Peter Lauri wrote: Hi guys, I am reviewing an affiliate system that I created a while ago. I am using a very simple method to do this, but I am curious if there is any better system (better I mean less missed affiliate purchases). 1. User click on affiliate link http://thedomain.com/?a=1234 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and then set a cookie for that 3. At purchase, we check if that cookie still is there, if so, we register it as a affiliate purchase and that info is stored in the purchase database What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. Maybe I can also create a SESSION that stores the affiliate information so that it at least get registered if the purchase is completed within the session? What do you think is the best way? Best regards, Peter Lauri www.lauri.se - personal web site www.dwsasia.com - company web site -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Affiliate system
That is probably what I will do. Thanks for your comment. -Original Message- From: Andrei [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 13, 2006 2:43 PM To: [php] PHP General List Subject: Re: [PHP] Affiliate system I ran into same issue with a site... I solved this problem by saving information in 2 places (in cookies and in database). So when saving data once I saved in the cookie then into database. When I wanted to read the information I first check if cookie exist and if it doesn't I read from database. Andy Peter Lauri wrote: Hi guys, I am reviewing an affiliate system that I created a while ago. I am using a very simple method to do this, but I am curious if there is any better system (better I mean less missed affiliate purchases). 1. User click on affiliate link http://thedomain.com/?a=1234 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and then set a cookie for that 3. At purchase, we check if that cookie still is there, if so, we register it as a affiliate purchase and that info is stored in the purchase database What should I do if they do not allow cookies? I could amend a=1234 onto every url that they pass, but that would not be a beautiful solution. Maybe I can also create a SESSION that stores the affiliate information so that it at least get registered if the purchase is completed within the session? What do you think is the best way? Best regards, Peter Lauri www.lauri.se - personal web site www.dwsasia.com - company web site -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php