addok.php里面
开头你加一句print_R($_POST['addname']);
你就可以看到,你传过来的数组的值了。

解决方案 »

  1.   

    $_POST['addname']是由你选择的名称组成的一维数组。
      

  2.   

    http://61.142.238.117/labor/workspace.html进入 工业园A区 - 村委会 - 俊景花园
    点击进入右边的三个小人的图标
    看看 ^_^是不是这种效果?
      

  3.   

    <?
    require ("config.php");
    $names = $_POST['addname'];
    $conn=mysql_connect("本地数据库", "vcom", "vcom");
    mysql_select_db("test");
    foreach($names as $key=>$name){
    $sql="select Filename from download where Filename='$name'";
    if(mysql_num_rows(mysql_query($sql))>=1)
    unset($names[$key]);
    }
    $str = implode(",",$names);
    $conn=mysql_connect("远程数据库", "vcom", "vcom");
    mysql_select_db("test")
    $sql="select Id from download where Filename in ($str)";
    @$result=mysql_query($query)
    while($rs=mysql_fetch_object($result)){
        $tmp[] = "('$rs->Url', '$rs->Filename', '$rs->Size', '$rs->$Status', '$rs->Finishsize', '$rs->Addedtime', '$rs->Endtime', '$rs->Starttime', '$rs->Actulstart', '$rs->Bitrate')";
    }
    $conn=mysql_connect("本地数据库", "vcom", "vcom");
    mysql_select_db("test")
    $query = "insert into download (Url,Filename,Size,Status,Finishsize,Addedtime,Endtime,Starttime,Actulstart,Bitrate) values ";
    $query .= implode(',', $tmp);
    @$result=mysql_query($query);
    if ($result)
       echo "<font color=red>恭喜您!成功添加记录!</font>";
    else
       echo "<meta http-equiv='refresh' content='2; url=add.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";
    ?>
      

  4.   

    Parse error: parse error in /home/apache/focus/load/addok.php on line 156应该是这行出错
    $sql="select Id from download where Filename in ($str)";
      

  5.   

    $sql="select Id from download where Filename in ($str)";
    换成$sql="select * from download where Filename in ($str)";错误不是这的错,是有几个行的结尾我没写“;”
      

  6.   

    <?
    require ("config.php");
    $names = $addname;
    require ("config.php");
    foreach($names as $key=>$name){
    $sql="select Filename from download where Filename='$name'";
    if(mysql_num_rows(mysql_query($sql))>=1)
    unset($names[$key]);
    }
    $str = "'".implode("','",$names)."'";
    if($str=="''") die('没有要新添加的条目');require ("config_2.php");
    $sql="select * from download where Filename in ($str)";
    @$result=mysql_query($sql);
    while($rs=mysql_fetch_object($result)){
          $tmp[] = "('".$rs->Url."', '".$rs->Filename."', '".$rs->Size."', '".$rs->$Status."', '".$rs->Finishsize."', '".$rs->Addedtime."', '".$rs->Endtime."', '".$rs->Starttime."', '".$rs->Actulstart."', '".$rs->Bitrate."')";
    }
    require ("config.php");
    $query = "insert into download (Url,Filename,Size,Status,Finishsize,Addedtime,Endtime,Starttime,Actulstart,Bitrate) values ";
    if(!is_array($tmp)) die('远端数据库查找失败');
    $query .= implode(',', $tmp);
    @$result=mysql_query($query);
    if ($result)
       echo "<font color=red>恭喜您!成功添加记录!</font>";
    else
       echo "<meta http-equiv='refresh' content='2; url=add.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";
    ?>
      

  7.   

    <?
    require ("config.php");
    $ids = $addname;
    require ("config.php");
    foreach($ids as $key=>$id){
    $sql="select Id from download where Id=$id";
    if(mysql_num_rows(mysql_query($sql))>=1)
    unset($ids[$key]);
    }
    $str = implode(",",$ids);
    if($str=="") die('没有要新添加的条目');require ("config_2.php");
    $sql="select * from download where Id in ($str)";
    @$result=mysql_query($sql);
    while($rs=mysql_fetch_object($result)){
          $tmp[] = "('".$rs->Url."', '".$rs->Filename."', '".$rs->Size."', '".$rs->$Status."', '".$rs->Finishsize."', '".$rs->Addedtime."', '".$rs->Endtime."', '".$rs->Starttime."', '".$rs->Actulstart."', '".$rs->Bitrate."')";
    }
    require ("config.php");
    $query = "insert into download (Url,Filename,Size,Status,Finishsize,Addedtime,Endtime,Starttime,Actulstart,Bitrate) values ";
    if(!is_array($tmp)) die('远端数据库查找失败');
    $query .= implode(',', $tmp);
    @$result=mysql_query($query);
    if ($result)
       echo "<font color=red>恭喜您!成功添加记录!</font>";
    else
       echo "<meta http-equiv='refresh' content='2; url=add.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";
    ?>
      

  8.   

    echo "<tr>";
      echo "<td bgcolor='#ffffff' align='center'><input type='checkbox' name='addname[]' value='$rs->Id'></td>"; 
      echo "<td bgcolor='#ffffff' align='center'>$rs->Filename</td>";  
    改成echo "<tr>";
    $id = $rs->Id;
    $name = $rs->Filename;
    echo "<td bgcolor='#ffffff' align='center'><input type='checkbox' name='addname[]' value='$name'></td>";
    echo "<td bgcolor='#ffffff' align='center'>$name</td>";