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?

Recommended Answers

All 4 Replies

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?

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

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.