Home > php教程 > php手册 > php代码

php代码

WBOY
Release: 2016-06-06 20:00:40
Original
1931 people have browsed it

总是不能上传成功图片,请大家帮忙解决下吧 upfile.php页面的代码是下面: ?php function filename() { $bbb=getdate(); $filenames=$bbb['year'].$bbb['mon'].$bbb['mday'].$bbb['hours'].$bbb['minutes'].$bbb['seconds'].".jpg"; return $filenames; } $n

总是不能上传成功图片,请大家帮忙解决下吧
upfile.php页面的代码是下面:
function filename()
{
$bbb=getdate();
$filenames=$bbb['year'].$bbb['mon'].$bbb['mday'].$bbb['hours'].$bbb['minutes'].$bbb['seconds'].".jpg";
return $filenames;
}
$newfilename=filename();
$upload_dir=getcwd()."\image\";

$newfile=$upload_dir.$newfilename;
$newfile=stripslashes($newfile);

if(file_exists($_FILES['upfile']['tmp_name']))
{
move_uploaded_file($_FILES['upfile']['tmp_name'],$newfile);
}
else
{echo "error";}

?>

主页面的代码是下面:

上传文件:
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template