fabiez Posted December 10, 2010 Share Posted December 10, 2010 Hi I was thinkin that I wanna make a simulor function to the one they use on betting site... User sees Team1 vs Team2 When he clicks "team2" it gets registered somewhere before he clicks "bet" wich inserts all his bets somewhere. Link to comment https://forums.phpfreaks.com/topic/221209-complexed-clicked-link-add-row-action/ Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 1. Use session/cookie, I'd probably use a cookie ( http://no2.php.net/manual/en/function.setcookie.php ) It remembers it in the web browser. 2. You can also store it in a db both times, make column for if it is temp or final. You would need something unique to identify the person though. Is there not any username or whatever, then use the ip, or set an unique random cookie that you can identify the person in the db by. (seems like a waste). So I'd maybe use the ip or just use cookie for the temp. Again store it as a cookie till it's been locked would be the best, and store it in the db afterward would be good. You can also make it write to a text file instead of a db. ( http://www.tizag.com/phpT/filewrite.php ) Would be okay to use when it's getting locked. Link to comment https://forums.phpfreaks.com/topic/221209-complexed-clicked-link-add-row-action/#findComment-1145298 Share on other sites More sharing options...
fabiez Posted December 10, 2010 Author Share Posted December 10, 2010 I use session, but lets say its four bets first he pick 1,3 and 4 and then he removes 3 and adds 2. I feel a problem coming And there won't always be 4 choices 1. Use session/cookie, I'd probably use a cookie ( http://no2.php.net/manual/en/function.setcookie.php ) It remembers it in the web browser. 2. You can also store it in a db both times, make column for if it is temp or final. You would need something unique to identify the person though. Is there not any username or whatever, then use the ip, or set an unique random cookie that you can identify the person in the db by. (seems like a waste). So I'd maybe use the ip or just use cookie for the temp. Again store it as a cookie till it's been locked would be the best, and store it in the db afterward would be good. You can also make it write to a text file instead of a db. ( http://www.tizag.com/phpT/filewrite.php ) Would be okay to use when it's getting locked. Link to comment https://forums.phpfreaks.com/topic/221209-complexed-clicked-link-add-row-action/#findComment-1145302 Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 I don't see the problem though. If there is one cookie per "match". To change the cookie, just re-set it with the same function. You said they could only pick one alternative to win per match, but if it's 10 teams and 3 to pick out per match. 10P3 alternatives. So that would be no happy time making a function for. I would then instead make one cookie per position you can pick per match too. Link to comment https://forums.phpfreaks.com/topic/221209-complexed-clicked-link-add-row-action/#findComment-1145307 Share on other sites More sharing options...
fabiez Posted December 10, 2010 Author Share Posted December 10, 2010 hahah so I'm screwed cause it's not always gonna be for example a maximum of 10 games. Or I should start trying on my own first... I don't see the problem though. If there is one cookie per "match". To change the cookie, just re-set it with the same function. You said they could only pick one alternative to win per match, but if it's 10 teams and 3 to pick out per match. 10P3 alternatives. So that would be no happy time making a function for. I would then instead make one cookie per position you can pick per match too. Link to comment https://forums.phpfreaks.com/topic/221209-complexed-clicked-link-add-row-action/#findComment-1145352 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.