View Full Version : create a ?id=X page

11-03-2010, 10:18 AM
I'm scanning a folder for images, if there's more then 1 image, I want to display a "more" link. (I have done this). Now when you click the link, I want to direct the user to a link like this index.php?id=X ? and how do I fill the page out?

how can I do that? I'm not sure what it's called, searching for ?id= on google is not much help :P

11-03-2010, 04:48 PM
This is passing a variable by GET.

So if you pass someone a page with ?id=4 at the end, you can retrieve the 4 by doing

$id = $_GET['id'];

Remember, if this is going anywhere near a database/exec/search/anything, saniitize. Otherwise, what you do from there is up to you.