Xander756 Posted June 14, 2007 Share Posted June 14, 2007 I am looking for the code that will allow me to create large picture galleries where if the thumbnail is clicked it will open on the site on a page by itself. Since I have thousands of pictures it would really be a pain to have to create thousands of pages and then put the picture on each one with html. Is there a way to do this with PHP? Quote Link to comment Share on other sites More sharing options...
MemphiS Posted June 14, 2007 Share Posted June 14, 2007 <?php $displayIMG = addslashes(strip_tags($_GET['imageiD'])); if (!ctype_digit($displayIMG)){ echo("Invalid image!"); exit(); } ?> <!-- html section --> <img src='images/<?php echo("$displayIMG"); ?>.gif' border='0' /><br /> <!-- Save your images as: 1.gif,2.gif etc... --> <a href="./photos.php?imageID=1">Image 1</a><br /> <a href="./photos.php?imageID=2">Image 2</a><br /> <a href="./photos.php?imageID=3">Image 3</a><br /> <a href="./photos.php?imageID=4">Image 4</a><br /> Pretty basic code but will get you on track.. Quote Link to comment Share on other sites More sharing options...
Xander756 Posted June 20, 2007 Author Share Posted June 20, 2007 I don't think I understand. What do I need to change in that code and where do I put it. On the page that I want the picture to show up after the thumbnail is clicked? And how to I make the actual gallery? Quote Link to comment Share on other sites More sharing options...
Xander756 Posted June 20, 2007 Author Share Posted June 20, 2007 On the page I want to make the thumbnail gallery (named test2.html) I have put: <html> <body bgcolor="black"> <a href="./test.php?imageid=1"><img width="250" height="250" src="images/1.jpg"></a><br /> </html> Then on the page I want the picture to show up (named test.php) I put" <html> <head> <title>Hello </title> </head> <body bgcolor="black"> <font color="white"> <?php $displayIMG = addslashes(strip_tags($_GET['imageiD'])); if (!ctype_digit($displayIMG)){ echo("Invalid image!"); exit(); } ?> <!-- html section --> <img src='images/<?php echo("$displayIMG"); ?>.jpg' border='0' /><br /> </body> </html> But I only get "Invalid Image!" when I click it. Quote Link to comment Share on other sites More sharing options...
Xander756 Posted June 24, 2007 Author Share Posted June 24, 2007 Okay well I got that coding to work but there is one problem. Is there anyway to edit the size of the images that makes it appear? I have some images that are like 1000x1000 others that are like 800x300 and some that are 300x800 so I can't just put one setting in the img src code. Anyway I can have it shrink to fit on a page? Quote Link to comment Share on other sites More sharing options...
Xander756 Posted June 29, 2007 Author Share Posted June 29, 2007 How do I shrink an image based on percentages with PHP?! It has been over a week and nobody has helped me. Quote Link to comment Share on other sites More sharing options...
solarisuser Posted June 29, 2007 Share Posted June 29, 2007 google search "greybox" or "lightwindow" 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.