HTML-PHP Uploader Query
well, for a college project I'm designing an uploader site (u give it a file, it uploads it...kinda like imageshack or mediafire). Anyway, I got the whole thing working well with a html form and a php script to store the uploaded file in a "/uploads" folder.
now here's the thing.....I want to have a drop down list in HTML section, and depending on value selected there, the file gets uploaded to appropriate folder....eg. if dropdown list has options a,b,c,d,e, and I choose a, I want file to be uploaded to "uploads/a", if I choose c, then "uploads/c" etc
Is this possible?? if yes, how do i开发者_开发百科 go about this??
I have very limited knowledge bout PHP so would really appreciate some guidance here!!
Thanks in advance cheers!!
Give a value for each option the the select list. When you submit the form, do something like this, where the selected choice value gets appended on to the upload target. Should put your files into the folder you want.
$folder_subsection = $_POST['selectVal'];
$upload_target = '/uploads/'.$folder_subsection;
精彩评论