Posted: Wed Oct 17, 2007 8:50 pm Post subject: Question regarding PHP and MySQL
First off, hello everyone.. My first post..
I am working on a form in PHP that uses a MySQL DB. Part of my form contains some text files, the second part is a file upload area. I have mixed some code together so that on submit it populates the DB with data from the text fields and then uploads the files to their locations.. My issue is, I would also like to take the file name from the upload box (not the entire path, just the file.extention) and place that information into a field in the DB as well. I have tried submitting the upload field name as text to the DB but that did not work.. Any ideas? Here is that section of code..
if (move_uploaded_file($_FILES['userfile1']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Upload failed";
}
if (move_uploaded_file($_FILES['userfile2']['tmp_name'], $uploadfile2)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Upload failed";
}
if (move_uploaded_file($_FILES['userfile3']['tmp_name'], $uploadfile3)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Upload failed";
}
echo "</p>";
echo '<pre>';
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
}
[/code:1]
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum