Shoutbox woes :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Crispin_Java
Forum Newbie
Posts: 8
Joined: Thu Feb 05, 2009 2:34 pm

Shoutbox woes :(

Post by Crispin_Java »

Hi Everyone,
I recently coded a 'chatbox' for my site. I made it 'live' so that if someone posts a message, it shows up without you refreshing the page. To do this, I use: setInterval ( "myfunction()", 5000 ); to call an ajax function which checks if there are any new posts. The thing is, my webserver tells me that I have the max number of processes running (all calling this ajax function which checks if there are new posts). The ajax function is getting called every 5 seconds by tons of people even if there are no new posts... Can I make it so that the server updates all of the peoples browsers when someone someone posts a message, instead?
Thanks a lot!
Cheers,
Crispin
Crispin_Java
Forum Newbie
Posts: 8
Joined: Thu Feb 05, 2009 2:34 pm

Re: Shoutbox woes :(

Post by Crispin_Java »

Wow, I must be getting pretty good a php when I am having totally original problems :banghead: :D
Post Reply