show hide block of code/records

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
warren
Forum Newbie
Posts: 3
Joined: Mon Jun 06, 2005 7:34 am

show hide block of code/records

Post by warren »

hi all hope you can helf me.basically i would like to hide show some database rows not on the first page but only if the person clicks on a url does it show the rows all this is done on one single php page. is there a way of doing this?

regards warren
User avatar
MathewByrne
Forum Commoner
Posts: 38
Joined: Sat Mar 27, 2004 9:49 pm
Location: Australia

Post by MathewByrne »

There are a lot of different ways of doing this.
An easy way would be using $_REQUEST variables in the URL, your hyperlink would look like:

Code: Select all

<a href=&quote;http://www.yourdomain.com/page.php?show=1&quote;>Link</a>
Then all you need to do is check in your script for the presence of this variable:

Code: Select all

if($_REQUEST["show"] == 1) {
   // show all rows
}
else {
   // only show some rows
}
warren
Forum Newbie
Posts: 3
Joined: Mon Jun 06, 2005 7:34 am

Post by warren »

you are a frekin genius thanks it worked berry well

regards

Warren Grant
Post Reply