View Single Post
Old 02-05-2007, 12:52 PM   #9 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Then change the fn in my code, to be file since you call that input field file.
At the same time you can remove the
PHP Code:
          if(mysql_query("INSERT INTO images (person_id, name) VALUES (\"".$_POST['person_id']."\", \"".$filename."\")"$DB_LINK))
            
$message "Image has been stored: $filename";
          else
            
$message "Couldn't store image to database"
part, since you're not adding anything to a database, you're simply uploading the image..

Also make sure the "../images/" reference I have in mine is according to where you plan on locating the images.

And please bear in mind, mine will rename the image files to current seconds since 1970, in order to assure theres no two images stored under the same name.

Altho this all seems to me, like you're just taking whatever code beeing shown, without thinking how it will fit your usage...
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline