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>";
}
在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>";
}
就是A.htm 页面的表单数据传到 b.php 中的 $_POST 数组中。
如果才能转移动 C.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> ";
}