converted from standard mysqli to mysqli prepared statements for security against sql injection

This commit is contained in:
2025-04-01 15:03:01 -06:00
parent e8ac27b5d5
commit cec9091ee0
7 changed files with 190 additions and 175 deletions
-16
View File
@@ -26,9 +26,6 @@ if (isset($_POST['form_id'])) {
header('Location: user.php?action=view&user_id=' . $_COOKIE['user_id']);
}
break;
case 'login_form':
$msg = login(
$_POST['username'],
@@ -39,9 +36,6 @@ if (isset($_POST['form_id'])) {
if ($msg === true)
header('Location: .');
break;
case 'reset_pw_form':
$msg = reset_password(
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
@@ -50,9 +44,6 @@ if (isset($_POST['form_id'])) {
);
break;
case 'update_email_form':
$msg = update_email(
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
@@ -61,20 +52,13 @@ if (isset($_POST['form_id'])) {
);
break;
case 'update_username_form':
$msg = update_username(
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
$_POST['new_username'],
$_POST['verify_new_username']
);
break;
case 'delete_account_form':
$msg = delete_account(
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),