|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am building a new website that allows members to upload images. I am using a program called Gallery to build the site (I have got it working and set the site up). I have located a php script that allows users to upload an image. The form they need to complete will be very simple, but I want it to include their username without the need for manual input. The images will be uploaded directly to the server so I need to match up an image with the user who submitted it as there will be other information in the form that needs to be added alongside the image.
My question is; how do I do it? I have been looking at cookies or sessions, but I could really do with some advice on the whole process. I am also a little wary about security. The upload folder is password protected but I really think I should be doing more than just that. How can I protect myself against viruses etc? Any help on this would be greatly appreciated, it is very much a work in progress at the moment.... EDIT - I have been thinking about this - could the ouput of the form create a html file containing the image and the form fields? Last edited by dux; 02-24-2008 at 09:58 AM. |
|
|||
|
Hi, just my 2 cents but why reinvent the wheel when you can use something like Coppermine Gallery which does this already and has a very active open source community which maintains code security and compatibilty updates.
|
|
|||
|
I had a look at CopperMine but there was something about it I didn't like, and I can't remember what that was right now.
Last edited by dux; 02-24-2008 at 11:21 AM. |
|
|||
|
If you're going to allow visitors to upload images, you can either use a third party script (like Coppermine) or have a good read of PHP documentation. PHP.net has a wealth of information and script snippets.
At the very minimum you're going to need to understand: * $_SESSION for associating the username they've logged in with the image so you can write it to the database or rename it * mime type checking to ensure that they don't upload an .exe or .php instead of a .jpg (it's no good just checking the extension) * renaming the files once uploaded so they don't contain malicious characters The process is not so hard, but to be security conscious it's worth doing some reading on how to prevent file upload attacks etc. Cheers, Nigel
__________________
------------------------------------------------- World Music World - bringing the World's Folk Music Cultures Together http://www.worldmusicworld.com/ ------------------------------------------------- |
|
|||
|
I hope I can say this - I browsed around, found a script that I was pleased with but it wasn't really what I wanted and it took some time to implement for what I wanted to do. I have multiple forms and multiple uploads of different types.
I browsed and tinkered more and then just got CoffeeCup form builder. (Can I say this - the company that is? I guess we'll see!) I'm pleased with it and have had no security issues at all. HTH Maggie |
|
||||
|
If don't have php programming experience you should hire a programmer or start with some tutorials:
PHP Tutorial - File Upload |
|
|||
|
I guess I am missing something here. Gallery is pretty secure on it's own and has a huge upload capability with file checking built in.
Do you want your gallery users to have direct access to your server ftp? I would never recommend that route! Also, coppermine has pretty much the same capability just presented differently. If you are attempting to go a simpler route that using the built-in functions of Gallery, you really do need to learn PHP! Using the super global variables like $_POST and $_SESSION are tools that every webmaster using PHP should know anyway. It will help you avoid those huge URL's that search engines don't like. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send form data with PHP | kurt.santo | Web Programming Discussion Forum | 13 | 01-13-2008 04:54 PM |
| Passing form data to remote form on another site | webace | Graphics & Design Discussion Forum | 8 | 08-31-2007 04:21 AM |
| Form data to PDF | Tim | Web Programming Discussion Forum | 15 | 04-28-2007 02:51 AM |
| New shopping directory, upload your images or logo | Mekchoudi | Link Exchange | 1 | 09-26-2006 12:39 PM |
| Pre-populating an HTML Form with Data from Another HTML Form | ambassador | Web Programming Discussion Forum | 3 | 06-19-2005 10:12 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |