Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2010
    Thanked 0 Times in 0 Posts

    create a ?id=X page

    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
    Last edited by cinek; 11-03-2010 at 12:21 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    New Jersey
    Thanked 259 Times in 256 Posts
    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

    PHP Code:
     $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.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts