a.htm页面post数据到b.php之后
在b 页面做查询数据库操作,然后判断$sql="select count(*) as c from tab where key='".$_POST['key']."'";
$query=mysql_query($sql);
$row=mysql_fetch_row($query);
if($row[0]>0)
{
  echo "<script>if(confirm('有重名,是否写入?')){location.href='c.php'}else{location.href='a.htm'}</script>";
}
else
{
  echo "<script>location.href='c.php'</script>";
}

解决方案 »

  1.   

    楼上的兄弟你的回复真是太好了。可否再帮我解答一个问题呢。
    就是A.htm 页面的表单数据传到 b.php 中的 $_POST 数组中。
    如果才能转移动 C.php 中的数组中呢?不用全局变量的话。谢谢了。
      

  2.   

    a.htm页面post数据到b.php之后 
    在b   页面做查询数据库操作,然后判断 $sql= "select   id as c   from   tab   where   key= ' ".$_POST[ 'key ']. " ' "; 
    $result=mysql_query($sql); if($result) 

        echo   " <script> if(confirm( '有重名,是否写入? ')){location.href= 'c.php '}else{location.href= 'a.htm '} </script> "; 

    else 

        echo   " <script> location.href= 'c.php ' </script> "; 
    }