Welcome to Dream.In.Code
Become a PHP Expert!

Join 150,019 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,496 people online right now. Registration is fast and FREE... Join Now!




Links to older postings on guest book

 
Reply to this topicStart new topic

Links to older postings on guest book

matt-the-mash
16 Nov, 2006 - 03:00 AM
Post #1

D.I.C Head
**

Joined: 10 Jul, 2006
Posts: 120



Thanked: 1 times
My Contributions
Hi,

Probably a simple solution to this, but i've got a simple guest book on a site where i list a total of 30 postings on the page.

How do i create a link to display 'older' postings?

Also, when i make a posting that contains special character's, i.e. ' (apostrophe) the output puts a '/' (slash) in there. I presume this is done with 'stripslashes' i have never used this before now, and therefore not sure where to put it.

This post has been edited by matt-the-mash: 16 Nov, 2006 - 03:26 AM
User is offlineProfile CardPM
+Quote Post

Tuzoid
RE: Links To Older Postings On Guest Book
16 Nov, 2006 - 04:04 AM
Post #2

D.I.C Head
Group Icon

Joined: 20 Aug, 2006
Posts: 120



Thanked: 2 times
Dream Kudos: 50
My Contributions
You can use SQL to limit what posts you acually see. So, in an example, you could only show posts that are 60 postings ago, but leave out those first 30:
CODE

SELECT * FROM tables ORDER BY id DESC LIMIT 30,60

So, just use that SQL code for showing those posts. For your slash problem. Just put stripslashes( ) around the content of what you want the slashes to be taken out of.

Hope this helped!
User is offlineProfile CardPM
+Quote Post

matt-the-mash
RE: Links To Older Postings On Guest Book
16 Nov, 2006 - 04:51 AM
Post #3

D.I.C Head
**

Joined: 10 Jul, 2006
Posts: 120



Thanked: 1 times
My Contributions
Thanks for that Tuzoid biggrin.gif The stripslashes works a treat!

Just going on the other queary, with regards the number of posts, is there a way of auto generating a hyperlink to view the next 30 posts once the limit has been reached. The same way as shown on this site when there are multiple pages?
User is offlineProfile CardPM
+Quote Post

Tuzoid
RE: Links To Older Postings On Guest Book
16 Nov, 2006 - 06:09 AM
Post #4

D.I.C Head
Group Icon

Joined: 20 Aug, 2006
Posts: 120



Thanked: 2 times
Dream Kudos: 50
My Contributions
Looks like your wanting a Paging System. Google for PHP Paging System. If you need any other help, just ask!
User is offlineProfile CardPM
+Quote Post

matt-the-mash
RE: Links To Older Postings On Guest Book
16 Nov, 2006 - 08:56 AM
Post #5

D.I.C Head
**

Joined: 10 Jul, 2006
Posts: 120



Thanked: 1 times
My Contributions
Thanks again Tuzoid! biggrin.gif

I found some code really quickly but it took a while to intergrate into what i have already done, but it was worth it!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 09:17PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month