Hi All,
I am using the following code to upload a file into a directory. It is working great but I would like the name of the file...to be the value ListID
I cant seem to do this....
I tried changin this line
$uploadfile = $uploaddir . $_FILES['photofile']['name'];
to
$uploadfile = $uploaddir . $_FILES['photofile']['ListID'];
But it didnt work...how can I do this?
mysql_query("INSERT INTO `listings` (`ListID`,`PropType`) VALUES ('$ListID','PropType')");
$uploaddir = '/httpd/customers/virtual/website/htdocs/admin/uploads/';
$uploadfile = $uploaddir . $_FILES['photofile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['photofile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";