JBTALKS.CC
标题:
Read error!???
[打印本页]
作者:
orangecola
时间:
2011-5-29 12:23 AM
标题:
Read error!???
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Upload an image</title>
</head>
<body>
<[quote]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Upload an image</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
//connect to database
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("databaseimage") or die(mysql_error());
//file properties
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
echo "Please select an image.";
else
{
$image = file_get_contents($_FILES['image']['tmp_name']);
$image_name = $_FILES['image']['name'];
$image_size = getimagesize($_FILES['image']['tmp_name']);
if ($image_size==FALSE)
echo "That's not an image.";
else
{
}
}
?>
</body>
</html>
想问下怎么样解决这个问题??{:4_351:}
[/quote]form action="index.php" method="POST" enctype="multipart/form-data">
File:
<input type="file" name="image"> <input type="submit" value="Upload">
</form>
<?php
//connect to database
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("databaseimage") or die(mysql_error());
//file properties
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
echo "Please select an image.";
else
{
$image = file_get_contents($_FILES['image']['tmp_name']);
$image_name = $_FILES['image']['name'];
$image_size = getimagesize($_FILES['image']['tmp_name']);
if ($image_size==FALSE)
echo "That's not an image.";
else
{
}
}
?>
</body>
</html>
想问下怎么样解决这个问题??{:4_351:}
复制代码
作者:
aeris123
时间:
2011-5-29 12:30 AM
$image_name = $_FILES['image']['name'];
换取
$image_name = $_POST['image']['name'];
?
欢迎光临 JBTALKS.CC (https://www.jbtalks.cc/)
Powered by Discuz! X2.5