Problem uploading file in php?

Saif Ur Rehman

New member
Every time i want to upload a file, after making the form in another page where from i access this upload.php file,and try to execute it, these errors pop up.
Notice: Undefined index: myfile in C:\wamp\www\File Upload\upload.php on line 12

Notice: Undefined index: myfile in C:\wamp\www\File Upload\upload.php on line 13

Notice: Undefined index: myfile in C:\wamp\www\File Upload\upload.php on line 14

Notice: Undefined index: myfile in C:\wamp\www\File Upload\upload.php on line 15

Notice: Undefined index: myfile in C:\wamp\www\File Upload\upload.php on line 16
Upload Complete!

HERE IS THE CODE I WROTE IN UPLOAD.PHP
<?php
$file = $_POST[
$name = $_FILES["myfile"]["name"];
$type = $_FILES["myfile"]["type"];
$size = $_FILES["myfile"]["size"];
$temp = $_FILES["myfile"]["tmp_name"];
$error = $_FILES["myfile"]["error"];
if($error>0)
{
die("Error uploadin file. Code! $error.");
}
else
{
move_uploaded_file($temp,"upload/",$name);
echo "Upload Complete!";
}
?>

if you guys could please help...
 
Back
Top