if(isset($_POST['submit']))无法执行
if(isset($_POST['submit']))
{
mysql_connect("localhost","root","");
mysql_select_db("soft");
mysql_query("set character set gbk");
$username=$_POST["username"];
$password=$_POST["password"];
$sql="insert into `users`(`name`,`pass`) values ('$username','$password')";
echo $sql;
mysql_query($sql);
mysql_close();
}
?>
点提交一直无法写入数据库,if(isset($_POST['submit']))根本不执行?求教
------解决方案--------------------测试过你的代码是没有问题的,除非你这个页不是dealadduser.php
PHP code
------解决方案--------------------难道你的本页不是dealadduser.php页吗?
如果不是,dealadduser.php页应该是
PHP code
<?php if(isset($_POST['submit']))
{
mysql_connect("localhost","root","");
mysql_select_db("soft");
mysql_query("set character set gbk");
$username=$_POST["username"];
$password=$_POST["password"];
$sql="insert into `users`(`name`,`pass`) values ('$username','$password')";
echo $sql;
mysql_query($sql);
mysql_close();
}
?> <div class="clear">
</div>
로그인 후 복사