<?php
if($_POST[button]) {
if(!($_POST[textfield] and $_POST[textfield2] and $_POST[textfield3] and $_POST[textfield4] and $_POST[textfield5]))
{
echo "<script language='javascript'> alert('输入不允许为空!'); </script>";
}
else
{
$conn=mysql_connect('localhost','root','root');
mysql_query("use tongxuhua");
$str1="insert into tb_mrbook values($_POST[textfield],$_POST[textfield2],$_POST[textfield3],$_POST[textfield4],$_POST[textfield5])";
$result=mysql_query($str1,$conn);
if($result)
echo "添加成功,单机<a href=chapter15.php>这里</a>查看";
else
echo "<script>alert('添加失败');</script>";
}
}
?>
运行的时候怎么都是“添加失败啊”。
if($_POST[button]) {
if(!($_POST[textfield] and $_POST[textfield2] and $_POST[textfield3] and $_POST[textfield4] and $_POST[textfield5]))
{
echo "<script language='javascript'> alert('输入不允许为空!'); </script>";
}
else
{
$conn=mysql_connect('localhost','root','root');
mysql_query("use tongxuhua");
$str1="insert into tb_mrbook values($_POST[textfield],$_POST[textfield2],$_POST[textfield3],$_POST[textfield4],$_POST[textfield5])";
$result=mysql_query($str1,$conn);
if($result)
echo "添加成功,单机<a href=chapter15.php>这里</a>查看";
else
echo "<script>alert('添加失败');</script>";
}
}
?>
运行的时候怎么都是“添加失败啊”。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货