Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - PHP/MySQL & AJAX | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
Mercury 0 Since: 11-18-05 Last post: 6600 days Last view: 6600 days |
| ||
Let's say, hypothetically speaking, that I would want to make some kind of chat system, using AJAX.
Where I have for example 2 fields, one texbox and one textfield. The textfield is where you could type your sentences, and the textbox is where everything would be visible after submitting your stuff (through PHP to a MySQL DB). So by using AJAX the textbox will be refreshed after 1 second? 5 seconds? 10 seconds? Would that be possible? I know how technically, but I mean, would it be 'healthy' for the server? It'll probably also depend on how long I set the refresh interval. Another example, some kind of live online userlist, where usernames appear/disappear on the fly if they log on/off, again every second, 5 seconds or 10 seconds or whatever (the shorter the interval, the more accurate of course...). So actually my question is, would using AJAX for stuff like this be a good idea (perhaps by choosing a larger interval (every 30 seconds)? Or would it be almost impossible for the server, or go too slow when there are more people online at the same time etc.? If I would use only PHP/MySQL, people would have to refresh themselves (so the whole page each time) to see changes, and that would slow down as well I guess (and be even worse for the bandwith?) |
|||
emcee Red Super Koopa Since: 11-20-05 Last post: 6431 days Last view: 6431 days |
| ||
I tried something like this a long time ago with Perl. It killed the server. I think AJAX is better for things where you only need to connect to the server periodicly, like when saving a file. | |||
Ogre Paragoomba Since: 07-12-06 Last post: 6521 days Last view: 6521 days |
| ||
Making a chat room via PHP isn't the best idea, but it can be done. You'd want to have the overall look and display of the page in one file, and iframe in the window where the actual display is. (Basically turn it into an overhauled tagboard with meta-refresh set to like 20-30 on the internal frame) |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - PHP/MySQL & AJAX | | |