0

I have seen on many sites using PHP some sort of id system where they can have a main page and then have different ids that will display completely different content. I am just wondering how you do this as I am in the process of making a screenshots gallery on my site. So lets say I go to example.com/image.php so that will take me to that page and then that would have 10 image thumbnails.

So when I click on them it will open up another dynamic page with only that image in so the url would be example.com/images.php?image=1. I have absolutely no clue how to do this, so if anyone can help with this probably it would be greatly appreciated.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by sv3tli0
1

In short line this is just way your PHP to recognize some ID .
with id= your PHP is getting the id of your gallery/ or id of some Database record and gets its information from your database..

Its using $_GET php function. in this case

example.com/images.php?image=1

$_GET["image"] will be equal to 1
after your script get this ID -1 it can collect information about the image with that id from your database and get it to the users.

Votes + Comments
Excellent advice!
0

Oh, that makes sense but say the thumbnails are a link how would I use the get method?

0

you must store in some way the information about your picture (id, location, thumb location) perhaps the best way is with Mysql database.
and to select the records from this database WHERE the id of your database record is equal to this $_GET.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.