<!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=gb2312" />
<title>无标题文档</title>
</head>
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="post" >
<input type="hidden" name="max_file_size" value=300000>
<input name="userfile" type="file" >
<input type="submit" >
</form>
</body>
</html>
<form enctype="multipart/form-data" action="upload.php" method="post" >
<input type="hidden" name="max_file_size" value=300000>
<input name="userfile" type="file" >
<input type="submit" >
</form>
</body>
</html>
//
//upload.php
<?php
$uploaddir="c://";
$uploadfile=$uploaddir.$_FILES['userfile']['name'];
print "<pre>";
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile))
{
print("上传成功!");
print_r($_FILES);
}
else
{
print("上传失败!");
print_r($_FILES);
}
print "</pre>";
?>
$uploaddir="c://";
$uploadfile=$uploaddir.$_FILES['userfile']['name'];
print "<pre>";
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile))
{
print("上传成功!");
print_r($_FILES);
}
else
{
print("上传失败!");
print_r($_FILES);
}
print "</pre>";
?>