0

Hi
I have an website. Where people may write short messages. Now I want that home page will display 10 recent messages from those posts.
So I want that New message will be shown and one oldest will be remove. All this will be down by ajax. Can anybody help me?

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by toms ace
0

Do you have your back-end implemented? If so, what technology are you using? Just return a plain HTML portion or use PHP? Also, how do you construct the display of all 10 posts?

0

Do you have your back-end implemented? If so, what technology are you using? Just return a plain HTML portion or use PHP? Also, how do you construct the display of all 10 posts?

I m new in web programming. What is back-end I dont know. I use mysql and php. I want that if someone post new message recent one will be shown and oldest one will be hide. this will be serially and odd-even color different.
thanks

0

The back-end is the server side where you communicate in Ajax. In plain words, you are sending a request which may contain parameter values to the server. Then the server construct contents consists of HTML/XML data that a browser can read and send back to you.

In your case, to add a comment display dynamically, you need to create a PHP page which display an expecting content from the server. In this case, you are displaying only 1 post. So if you actually create a post partial in PHP, you could reuse it over and over again.

To remove, you could simply use JavaScript to remove the element from the page after you get the response content back from Ajax. You could look at how to use Ajax at http://www.tizag.com/ajaxTutorial/ or http://www.w3schools.com/ajax/default.asp. :) For PHP part, you may ask the PHP forum about how to construct such a page for it. Though, some people may answer on this forum as well because they are closely related.

0

Can you post us the code that displays the list? or even the whole homepage code?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.