<分区>
Possible Duplicate:
Undefined index: file
你好,我正在学习如何将图像上传到数据库,但是我收到了这个错误/通知
Notice: Undefined index: image in C:\xampp\htdocs\Pildibaas\index.php on line 19
这是我的 index.php 的全部代码:
<!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>Image upload</title>
</head>
<body>
<form action="index.php" method="POST" enctype="multipart/form-data">
File:
<input type="file" name="image"> <input type="submit" value="Upload">
</form>
<?php
mysql_connect ("localhost", "root", "") or die (mysql_error());
mysql_select_db ("databaseimage") or die (mysql_error());
?>
</body>
</html>
从 index.php 中截取的第 19 行(此行出错):
echo $file = $_FILES['image']['tmp_name'];
从谷歌发现我需要更改 tmp 文件夹的权限,但它应该已经具备了它需要的所有权限。
在教程中他没有得到这个错误
谢谢