Bigg Posted April 16, 2007 Share Posted April 16, 2007 Sorry to double post but, I was wondering if any of you had any ideas with my AJAX / php chat. http://www.phpfreaks.com/forums/index.php/topic,136327.0.html Quote Link to comment Share on other sites More sharing options...
nogray Posted April 17, 2007 Share Posted April 17, 2007 You would need to store the messages somewhere (either text file or database) so the other users can get the data. Also, you might wanna use the encodeURI() function when creating the URL for your ajax. I also think you might want to make your http variable global so you can use it in other functions other than the ajaxfunction. Quote Link to comment Share on other sites More sharing options...
Goose Posted April 17, 2007 Share Posted April 17, 2007 I am making one right now actually, it is almost functional. Client side is all custom JavaScript that I have written (including all the AJAX code) and the backend is run by PHP and MySQL. The Theory is this (I say theory because it isn't complete yet, but close): User logs in (AJAX authentication with the database) then automatically joins the Default channel (which is another AJAX and db call). After that when they send messages an AJAX call is made and adds that message to the database for the specific room they are in. Every second an javascript function is fired off that checks the status (and grabs new messages) of the rooms you are currently in with an AJAX call. This function returns an XML file which is then parsed by my JavaScript (this is what I am having issues with at the moment) and updates the display. I don't know if that is helpful at all, but hopefully it is Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.