添加表单
程序员文章站
2022-05-28 14:52:13
...
无详细内容 ?phpheader('Content-Type:text/html;charset=utf-8');$locahost="localhost";$name="root";$password="root";$dbname='test';$con=mysql_connect($locahost,$name,$password,$dbname);if (!$con) { die('链接失败'.mysql_error());}mysql_select
alert('请输入标题');"; exit(0); } if (empty($_POST['count'])) { echo ""; exit(0); } if (strlen($_POST['title'])10) { echo ""; return true; } // 添加数据 $sql="insert into ji(title,count)values('$_POST[title]','$_POST[count]')"; $reqult=mysql_query($sql); if (!$reqult) { die('Error:'.mysql_error()); } echo "添加成功"; mysql_close($con); } ?>Document