SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2001
    Location
    San Diego, CA
    Posts
    617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upload, display, delete image

    I am setting up a youth soccer club site, and creating an admin section for each team so they can update their own team site. I want to allow them to upload their own team picture which will be displayed on the first page.

    The way I have it set up now is not very efficient and runs into a problem of displaying the ugly "image not found" error thingy if there is no picture uploaded yet.

    How would I create a way for the team managers to upload their team picture as any filename, and display it the proper size on the first page?

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?
    if(file_exists($image_file))
    {
      echo 
    "<img src='$image_file'>";
    }
    else
    {
      echo 
    "No image on record";
    }
    ?>
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •