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.
6 lines
250 B
PHP
6 lines
250 B
PHP
<?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']);
|