| Welcome to WebmasterWorld Guest from 188.8.131.52 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|PhP to upload images|
I just need a simple way for clients to upload an image and write a sentence or two underneath it. I have scoured HotScripts and resourceindex and gotten close but no cigar.
Any body got a script like this?
I've not got one to hand, but when you call a php script from an upload form [cgi-lib.berkeley.edu], php creates a variable using the name you gave to your <input type="file"> field.
This variable contains the path to the uploaded file - from there it'd be a pretty simple matter to move the file to somewhere more permanent and reference it from HTML.
I used this simple uploadform in an admin section for a travelsite I developed, it works and is easy to modify to your own needs.
It should work if you set the directory to have write permission (and php is not running in safe mode)
Hope this helps!
I must be in "ForRest Gump" mode again. Will have to wait for the brain juice to flow again but at least now I have something to jump right into.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved