I'm making a site that for users to submit photos and digital artwork for a contest.
I have it set up this way: the user enters first/last names and contact details. The script creates a folder in a "submissions" directory as first_lastname/ and the images s/he uploads are copied into that directory. All the personal info gets written to a log file in addition to the names of the files uploaded, etc.
{{At the beginning of the script I set a hard-coded $submission_path variable to be the location to where submissions are place. Insidethe $submission_path directory I create the $first_lastname directory, then copy the uploaded files to $submission_path."/".$first_lastname."/".$filename }}
Once the submission period is over, judges will be able to view the images in their browser windows. That script will just grab the file name from a directory listing.
Because user input is being written into files on the server, I can see how there's potential to insert malicious script into the various form fields. In my situation, it seems like a combination of the preg_match and strip_tags will work best. What do you think
Thanks!
Cameron