Fallen_angel Posted January 18, 2007 Share Posted January 18, 2007 Hi , I am building a FAQ system , everything has come together nicely and now I'm just trying to add a few more usability features to it , the thinhg in particular that i need assistance with is a link to move to the previous reccord and also the next reccord of the database , that way te users can flick through the guides without having to go back to the main menu the pages themselfs are accessed by going to www.domain.com/mainpage.php?id='faq-id'How would i go about creating the links to go back one reccord or forward one reccord as this obiosly has to change with the faq being viewed Thanx allot to anyone that can assist me Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 Are the ids numbers? Uhm...addition and subtraction?if the id is 4, the next is 5, and the previous is 3.... Quote Link to comment Share on other sites More sharing options...
Fallen_angel Posted January 18, 2007 Author Share Posted January 18, 2007 Yes they are sequential numbers and I understand how to manually navigate to them via url what i am not sure of is how to make the two links for next and previous on the fly each time a page is loaded , would something like the bellow work or am i on the righ track ?[code]$previous=$info['id'] - 1 ; $next=$info['id'] + 1 ; [/code] Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 ....yeah.Did ya try it? Quote Link to comment Share on other sites More sharing options...
Fallen_angel Posted January 18, 2007 Author Share Posted January 18, 2007 yep I had tried it however after posting it I relised that in my dev version I was missing the ; at the end thankyou so much for your help Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 No problem. Best of luck. Quote Link to comment Share on other sites More sharing options...
Fallen_angel Posted January 19, 2007 Author Share Posted January 19, 2007 Ok so I have this working except I can see a small issue that I'm not sure if I can fix or not , so thought I shoudl ask here once they get to the final existing reccord they can still click next tutorial and get a blank layout page that would normally be populated with info , Is there a way for me to have a default error page for if there is no information in the database that matches the search they get that instead of a blank layout page, the main reason beign that they can just click over and over and never find anythgin which could be confusing to some or is it even possible to make it so that the final row doesn't show the next tutorial link ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.