I am very new to php and am trying to create a simple application that uploads a PDF file to a database. I have one field for the Volume Number and on file field for the PDF to be uploaded. My issue is i can't get the PDF to upload or insert the name of the pdf (eg volume1.pdf) into the data base.
Here is what i have, please go easy on me this is my first round at php:
<?php
if(isset($_POST['submit'])){
$vol_num = $_POST['vol_num'];
$pdf = $_FILES['pdf']['name'];
$path = '../pdf/'.$_FILES['pdf']['name'];
move_uploaded_file($_FILES["pdf"]["tmp_name"], $path);
mysql_query("INSERT INTO volumes set vol_num='$vol_num', vol_link='$pdf'") or die (mysql_error());
echo "<script>location.href='add_volume.php'</script>";
}
?>
what am i doing wrong here?
Thanks in advance