hi guys, i already have a working upload.php, now the problem is that the file cannot accept pdf files? but other than that, it works very well, what do you think should i do with this?
echo"<form enctype='multipart/form-data' action='fileRecs.php' method='POST'>";
echo "<input type='hidden' name='MAX_FILE_SIZE' value =1000000/>";
echo "Choose a file to upload: <input name='uploadedfile' type='file' /><br />";
echo "<input type='submit' name ='upload2' value='Upload File' /></form>"
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$nameFile = basename( $_FILES['uploadedfile']['name']);
$upload2 = $_POST['upload2'];
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
$buttonPress = 2;
//establishing connection
mysql_connect("localhost", "joomla_user", "joomla") or die(mysql_error());
//connecting to the database
mysql_select_db("db_php") or die(mysql_error());
$result3 = mysql_query("SELECT * FROM files") or die(mysql_error());
mysql_query("INSERT INTO files (fileName) VALUES('$nameFile')") or die(mysql_error());
echo "<script>alert('Uploading of file successful')</script>";
}
else
{
echo "There was an error uploading the file, please try again!";
}