Forum Moderators: coopster

Message Too Old, No Replies

Update data to all users

php, ajax,javascript

         

rodriguez1804

2:35 am on Dec 1, 2010 (gmt 0)

10+ Year Member



Hey all,

I am having a problem updating new posts to ALL users.

What I want:
Something similar to what facebook has: users makes a post,
and ALL users reading that page get new post to top of posts.

What I have:
I am using ajax and php. User makes a new post and the new post is
shown for user MAKING the post, but anybody else that is viewing
the same page does not get the updated page with new post (unless
they refresh the page, but I don't want the users to have to refresh
page).

How can I or what approach should I take so that when a user makes a post, ALL USERS viewing that page will see the new post? I already have the page for the original poster getting the update, just need everybody else to also be able to see new posts.

Thanks.

Tommybs

1:00 pm on Dec 1, 2010 (gmt 0)

10+ Year Member



To me it sounds like you need a javascript function on the page that polls the server every 5 or 10 seconds (or whatever) and reloads the ajax content then. The difficulty in this is only updating the page if you need to do it.

Alternatively you could look at a variety of push ajax technologies and see if any of them fit the bill. The only 1 I know of off-hand is ape-project though I must admit I never got round to installing it

rodriguez1804

4:49 pm on Dec 1, 2010 (gmt 0)

10+ Year Member



Thanks a lot. I ll take a look into the ape-project.