The Dealer
Power Member
Estou a criar um sistema de upload de ficheiros .txt usando o seguinte código:
Mas dá-me o seguinte erro, quando no form faço submit:
Código:
<?php
include("Connections\connectDB.php");
$target = "D:\Projecto\PHP files\uploads";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
//This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if ($uploaded_type =="text/txt")
{
echo "No txt files<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>
Qual será o problema...?Notice: Undefined index: uploaded in D:\Projecto\PHP files\upload.php on line 15
Notice: Undefined variable: uploaded_size in D:\Projecto\PHP files\upload.php on line 19
Notice: Undefined variable: uploaded_type in D:\Projecto\PHP files\upload.php on line 26
Notice: Undefined index: uploaded in D:\Projecto\PHP files\upload.php on line 41
Sorry, there was a problem uploading your file.
Última edição: