Results 1 to 3 of 3

Thread: Image based on url?

  1. #1
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Image based on url?

    So I've got this website that has a lot of images (over 1000). For almost a year, every time I add images I create a new page for it. But that is getting very tiresome.

    I would like to have an automated system to view images from a single php page.

    so it would be: page.php?ID=imagename

    On that page, have a simple code like
    Code:
    <IMG SRC="<?php echo $picture.'.jpg'; ?>" BORDER="0">
    and the image would show up.

    Any help would be greatly appreciated!
    Last edited by Briggs; 12-14-2009 at 09:53 PM. Reason: Resolved

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    PHP Code:
    <?php
    $picture 
    $_GET['ID'];
    ?>
    Any other code you want then where you want your image.
    PHP Code:
    <img src="<?php echo $picture ".jpg"?>" border="0">

  3. #3
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    well that was easy! thank you very much.

Bookmarks

Posting Permissions

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