(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
06-18-24 03:31 PM
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: 6499 days
Last view: 6499 days
Posted on 07-29-06 11:08 AM Link | Quote
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: 6330 days
Last view: 6329 days
Posted on 08-01-06 07:02 AM Link | Quote
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: 6420 days
Last view: 6420 days
Posted on 08-01-06 03:52 PM Link | Quote
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 |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.026 seconds; used 356.95 kB (max 420.91 kB)