Page 1 of 1
allow users to post photos
Posted: Wed Feb 15, 2006 2:36 pm
by kristie380
Hi - I run a high school alumni website and I really want to allow my registered users to upload a picture of themselves to be included with their profiles. Their profiles are stored in MY SQL so I would need to have them upload their pictures to the database. Then I would need a script to call the picture from the database and format it. I have done a lot of research on the internet for scripts to help me but I can't seem to find anything that works. Can someone PLEASE help me? Thanks!
Posted: Wed Feb 15, 2006 2:52 pm
by chrys
an alternative would be to upload the images to a pics/ directory, a structure like this:
/path/to/site/pics/username.jpg
and then when you load their page you check
if( file_exists( "/path/to/site/pics/username.jpg" ) )
... display the image ...
If this sounds appeal, let me know and I can help further
Posted: Wed Feb 15, 2006 3:56 pm
by kristie380
so when they upload their picture, how do i change the name of the image (we'll say it's "1234.gif") to be their username - "username.gif" so that i can call up the picture?
Posted: Wed Feb 15, 2006 3:56 pm
by kristie380
and how would i re-size it to a thumbnail size?
Posted: Wed Feb 15, 2006 4:15 pm
by feyd
kristie380 wrote:so when they upload their picture, how do i change the name of the image (we'll say it's "1234.gif") to be their username - "username.gif" so that i can call up the picture?
To answer this, read
http://php.net/features.file-upload
Something to look at is
move_uploaded_file()
kristie380 wrote:and how would i re-size it to a thumbnail size?
there are several thumbnail scripts available on the forums here. At least one is in
Code Snippets.