Setting Number of images to display<

liunx

Guest
I would like to add a drop down box to my photo gallery that would let the user choose how many pictures they want displayed per page (like a choice of 15, 30, 50, or 100). What I was wondering, is...what's the best way to do this? I already have a variable in the gallery called "$photos_per_page" which is currently just set to 15. I could have it set to 15 only if it's not in the url, and have the dropdown send them to xgallery.php?photos_per_page=whatever. But then, would my next button have to pass it along in the url again and again? Is there a better way?just put the value in a session variable...

something like

session_start();
if (!isset($_SESSION['photos_per_page']))
{
$_SESSION['photos_per_page']=15;
}
if (isset($_GET['photos_per_page']))
{
$_SESSION['photos_per_page']=$_GET['photos_per_page'];
}Watch it. If that SESSION variable is one that gets passed along in the URL, then your site will appear toxic to Google and your siye will not get indexed. Read up on the search engine implications, and workarounds, before implementing SESSIONs.you mean that ?phpsessid=something is toxic and won't be indexed??

i will search that matter...
 
Top