Can an attacker send the $_POST method any bilberda, bypassing the form? For example, I expect to receive $_POST['userName'] and $_POST['userEmail'] , and I receive $_POST['iAm'] and $_POST['coolHacker'] . In that case, if the field names are critical for me, and then I use them in my script - this can disrupt its work. In order not to work directly with the $_POST array, is it advisable to process it in the following way?
$formData = ['field1Name' => '', 'field2Name' => '']; foreach ($formData as $fieldName => $value) { if (isset($_POST[$fieldName])) { $formData[$fieldName] = $_POST[$fieldName]; } }
very."(),:;<>[]".VERY."very@\\\\\\ \"very<script>alert(1)</script>".unusual@strange.example.comis quite a valid email address according to RFC :) - andreymal