to vivanboy(被迫早起的鸟儿)什么错误提示也没有,看看数据库,里面也没插入记录!不知道那里出错,特来求教!

解决方案 »

  1.   

    <?
    include"config.php";
    if($title==''){
    echo"<script>alert('文件名为空,请返回……\\t');history.go(-1);</script>";
    die();
    }
    $select="select count(*) as numRe from $table_image where title='$title'";
    $pp=mysql_query($select);
    if(mysql_result($pp,0,'numRe')){
    echo"<script>alert('文件名重名,请返回重试……\\t');history.go(-1);</script>";
    die();
    }if(!empty($file))
    {
     if(file_exists("../data/$file_name"))
    {
     echo"<script>alert('该图片已经存在,请换个文件名');history.go(-1);</script>";
     die();
    }else{
    $copy=copy("$file","../data/$file_name");
    unlink($file);
    if(!$copy){
    echo"<script>alert('文件上传不成功!');history.go(-1);</script>";
    die();
    }
    $insert="insert into $table_image set title='$title',file='$file_name',con='$con',date=now()";
    $q=mysql_query($insert);
    if($q){
    echo"<script>alert('文件上传成功……\\t');history.go(-1);</script>";
    }
    }
    }
    ?>
      

  2.   

    die()放在那里是什么意思?谢谢!