-2
/* here i have coded to upload a video file.. but it is not uploaded due to $_files['pagef']['tmp_name'] is empty */
if(isset($_POST[Upload]))
{
if($_POST[dname]=="")
{
$c=1; $m="Please Enter File Name";
}
if($_POST[dname]!="")
{
$s=mysql_query("Select * from ai_downloadfiles where dname='$_POST[dname]'");
if(mysql_num_rows($s)>0)
{
$c=1;
$msg="File Name already created..."; /*error message*/
}
}
if($_FILES['pagef']['name']!="")
{
$ext=getFileExtension($_FILES['pagef']['name']);
$fn=uniqid("").".".$ext;
if(move_uploaded_file($_FILES['pagef']['tmp_name'],"../downloadfiles/$fn"))
{
$c=0;
}
else
{
$c=1;
$msg="Cant Uploaded";
}
}
if($c==0)
{
$cur=date("Y-m-d");
$s=mysql_query("insert into ai_downloadfiles (dname,files,cdate,ctime)
values('$_POST[dname]','$fn','$cur',now())") or
die(mysql_error());
}
}
我建議你清理後了一點,所以我們實際上可以讀取的代碼正確,使您有問題,不清楚是什麼。 – Tom 2012-03-30 11:04:09
您是否也可以爲您使用的表單添加HTML – BenOfTheNorth 2012-03-30 11:09:36
也可以包含您上傳的HTML表單 – 2012-03-30 11:10:06