上传图片报错,请大家帮忙解决一下!
<?php
if($add=="添加")
{
if(($file!="none")&&($file!=""))
{
$path=addslashes(dirname($PATH_TRANSLATED))."/ztimg/";
$filetype=strstr($file_name,".");
$n=date("YmdHis");
$newfilename=$n.$filetype;
$filename=$path.$newfilename;
copy($file,$filename);
unlink($file);
$img="/admin/ztimg/".$newfilename;
}
mysql_query("insert into zhuanti (title,img,url,sj)values('".$title."','".$img."','".$url."','".$sj."')");
?>
<script language=javascript>
alert("添加成功!")
document.location="news_zhuantiadmin.php"
<\/script>
<?
}
else
{
?>
<LINK href="pic/css.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function check1()
{
if (document.form1.title.value=="")
{window.alert("请填写专题活动标题!");
return false;}
if (document.form1.file.value=="")
{window.alert("请选择专题活动导航图!");
return false;}
if (document.form1.url.value=="")
{window.alert("请填写专题活动地址!");
return false;}
if (document.form1.sj.value=="")
{window.alert("请填写专题活动时间!");
return false;}
}
<\/script>
<body>
<form action="news_zhuantiadd.php" method="post" enctype="multipart/form-data" name="form1" target="_self" id="form1" onSubmit="return check1(this.form)">
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0099CC">
<tr align="center">
<td height="25" colspan="2"><strong>专题新闻添加项目</strong>(<a href="news_zhuantiadmin.php">查看</a>|<a href="news_zhuantiadd.php">添加</a>)</td>
</tr>
<tr align="center">
<td width="107" height="25" align="center"><strong>专题题目</strong></td>
<td width="687" height="25" align="left"><input name="title" type="text" id="title" size="50" class="input">
*必填,不必严格参照17字标准执行<img src="pic/ruler.gif" width="360" height="15"></td>
</tr>
<tr align="center">
<td height="25" align="center"><strong>导航图片</strong></td>
<td height="25" align="left"><input name="file" type="file" class="input" size="40">
图片标准尺寸250*190px,大小100K以内,jpg格式</td>
</tr>
<tr align="center">
<td height="25" align="center"><strong>专题地址</strong></td>
<td height="25" align="left"><input name="url" type="text" class="input" id="url" value="http://www.sxdn.com.cn/zhuanti/" size="60">
*填写文件夹文件名上传至空间</td>
</tr>
<tr align="center">
<td height="25" align="center"><strong>开始时间</strong></td>
<td height="25" align="left"><input name="sj" type="text" id="sj" size="20" class="input" value="<?=date("Y-m-d")?>"></td>
</tr>
<tr align="center">
<td height="25" colspan="2"><input name="add" type="submit" value="添加" class="button"> <input type="reset" name="Submit2" value="重置" class="button">
</td>
</tr>
</table>
</form>
</body>
<? }?> ;
错误提示:Warning: copy(Array): failed to open stream: No such file or directory in D:\it022\htdocs\admin\news_zhuantiadd.php on line 12
Warning: unlink(Array): No such file or directory in D:\it022\htdocs\admin\news_zhuantiadd.php on line 13
我的调试环境是win2003 ii6.0+PHP Version 4.4.0+mysql-4.0.26-win32 请大家帮忙解决一下!谢谢