Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-10-2010, 10:14 PM #1
- Join Date
- Sep 2009
- Thanked 0 Times in 0 Posts
Re-check variable from postback every X seconds?
OK, I have a content gateway that I'm trying to make it instant upon crediting of an offer.
I need a way to store the user's session into a database, and and create a column named 'credit' and automatically fill it with '0'. Need a way to check the database every X seconds to see if a variable being posted to the site from another has a value of '1'
There's some PHP involved yeah, but I was told that Ajax would be the way to constantly check every so often?
If you can help, post here, or add my MSN; paul/@/blockis.com or AIM; Blockislandpaul
09-13-2010, 05:36 PM #2
- Join Date
- Jun 2002
- London, UK
- Thanked 110 Times in 109 Posts
You could do it with AJAX. Simply fire a request to the server every x seconds and return a bunch of JSON. However, this is a simple and effective way to reduce a perfectly happy production server to a pile of smoking metal: get a thousand users all firing their update requests every few seconds and you'll effectively DDOS yourself.
Another solution - albeit a HTML5 one - might be to use a combination of Web Sockets and something like node.js. It's not simple, but it's scalable.