Hi, All.I can't upload files using PHP under XAMMP.Take ta look:
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="up.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input type="file" name="myfile" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
</body>
</html>
Now, see up.php page:
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo $_FILES[ 'myfile' ][ 'name' ];
?>
</body>
</html>
So, when I enter it on my browser, the follow message brings:
Notice: Undefined index: myfile in /opt/lampp/htdocs/up/up.php on line 11
Anybody there could you help me?
Thanks!