POST 'models'

Deduplicate POST value assignment for add/edit operations in post.php with a 'model' concept.
This should also help prevent things breaking when one of the functions are updated but the other is missed.
This commit is contained in:
Marcus Hill
2023-02-11 19:06:59 +00:00
parent c7d0a4ab16
commit 428dec3527
4 changed files with 42 additions and 51 deletions

5
models/user.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['name'])));
$email = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['email'])));
$default_company = intval($_POST['default_company']);
$role = intval($_POST['role']);