allow users to post photos
Moderator: General Moderators
-
kristie380
- Forum Commoner
- Posts: 36
- Joined: Sun Oct 09, 2005 10:51 pm
allow users to post photos
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!
Last edited by kristie380 on Wed Feb 15, 2006 3:51 pm, edited 1 time in total.
- chrys
- Forum Contributor
- Posts: 118
- Joined: Tue Oct 04, 2005 9:41 am
- Location: West Roxbury, MA (Boston)
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
/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
-
kristie380
- Forum Commoner
- Posts: 36
- Joined: Sun Oct 09, 2005 10:51 pm
-
kristie380
- Forum Commoner
- Posts: 36
- Joined: Sun Oct 09, 2005 10:51 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
To answer this, read http://php.net/features.file-uploadkristie380 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?
Something to look at is move_uploaded_file()
there are several thumbnail scripts available on the forums here. At least one is in Code Snippets.kristie380 wrote:and how would i re-size it to a thumbnail size?