(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
09-28-24 12:31 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - PHP/MySQL & AJAX
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Ogre
Posts: 52/65
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)
emcee
Posts: 478/867
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.
Mercury
Posts: 5/9
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?)
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.004 seconds; used 345.49 kB (max 379.54 kB)