#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep Power
    0

    Exclamation Adding a picture to this php/MySQL news system ?!


    http://www.devshed.com/Server_Side/P...ySQLPublishing

    If I wanted to add a jpeg to a news article how would I go about it ?
    i understand about file uploads using php but I am unsure on my own how to make it all link up to this system.

    Any help would really be appreciatated...

    p.s thanks for the tutorial !
    Last edited by Yorkz; October 18th, 2003 at 04:21 PM.
  2. #2
  3. Rut row Raggy!
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2001
    Location
    Tornado Alley
    Posts
    560
    Rep Power
    34
    You would need to add a column to the table for images (a varchar that allows you to input the filename should be enough), add an upload box in the add/edit forms (remember to use enctype="multipart/form-data" in the form tag), and add an image tag to part of the script that displays the article like this...

    <img src="images/$image.jpg"> //if your row variable was called $image and the image was stored in the images folder and was a jpg.

    If you posted some code in these areas, I could be more specific.
    Matt

IMN logo majestic logo threadwatch logo seochat tools logo