📄 add_new_user.php
字号:
<?include 'logged_in.php';include 'database_access.php';$login = $_POST['user'];$password = $_POST['pw'];$mobile = $_POST['phone'];$group = $_POST['group'];mysql_query("BEGIN");$query1 = "insert into user (login,password,mobile) values ('".$login."',OLD_PASSWORD('".$password."'),'".$mobile."')";mysql_query($query1);if (mysql_error()){ $_SESSION['sql_error'] = "Could not add user: ".mysql_error(); header('Location: accounts.php');}$query2 = "insert into userrolemap (userid, roleid) values (".mysql_insert_id().",".$group.")";mysql_query($query2);if (mysql_error()){ $_SESSION['sql_error'] = "Could not add user: ".mysql_error(); mysql_query("ROLLBACK"); header('Location: accounts.php');}mysql_query("COMMIT"); header('Location: accounts.php');?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -