file upload
Posted: Sat Jun 19, 2010 2:12 pm
Hi everyone im trying to fileupload but im getting some errors could you help please
here if($myfile_type == "image/gif" || $myfile_type == "image/png" || $myfile_type == "image/jpeg")
Notice: Undefined variable: myfile_type in C:\wamp\www\send.php on line 5
this is my source
here if($myfile_type == "image/gif" || $myfile_type == "image/png" || $myfile_type == "image/jpeg")
Notice: Undefined variable: myfile_type in C:\wamp\www\send.php on line 5
this is my source
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Doc<input name="" type="file" />ument</title>
</head>
<body>
<form action="send.php" method="post" enctype="multipart/form-data">
<input type="file" name="myfile" /><br />
<input type="submit" value="Send" />
</form>
</body>
</html>
<?php
$path_="images";
if($myfile_type == "image/gif" || $myfile_type == "image/png" || $myfile_type == "image/jpeg")
{
copy($myfile,"$path_/$myfile_name") or die("Error");
echo "File uploaded";
}
?>