Hello all,

I have a decent knowledge of php, but I have no idea how to approach this problem, or even if this requires php for that matter (I'm open to learning what this would require). In a certain area of my website, I have updates/messages from an admin being posted, and these messages are all stored in a database. Currently I know how to display all of the messages in one long page, but once I reach a certain limit say 5 messages, I want to have them be cut off, with a link/button to continue to the next 5, and then the next 5 after that. I would not like to have to completely refresh the page, but if this is the only way I guess that would be ok.

Thanks in advance,
Phil

You have defined what needs to be done and you say that you have a decent knowledge of PHP. So what is the problem? Display 5 messages and then display a button (as part of a form) with the action back to the same module (or not defined since it will default). You can pass back the range that you processed so it can know where to start for the next 5. You may need to do some initialization the first time through so you will need to segment the module a bit and skip some of that initial logic in subsequent passes. Straight PHP and HTML makes it necessary to re-display the whole page each time (but with new content each time). If you wanted to avoid re-displaying the page and just display another 5 messages then you would need some Ajax.

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.