$Post_[] gegen filter_input(INPUT_POST... ersetzt

This commit is contained in:
Andreas Hnida 2024-02-23 07:08:02 +00:00
commit cde1a10a84
3 changed files with 19 additions and 13 deletions

View file

@ -17,11 +17,13 @@ window.onload = function () {
document.getElementById('formular').addEventListener('submit', function (e) {
e.preventDefault(); // Verhindert die Standard-Formularsendung
var honeyPot = document.getElementById("verify_email").value;
var endTime = Date.now();
var timeSpent = (endTime - startTime) / 1000; // Zeit in Sekunden
document.getElementById("age").value = timeSpent;
document.getElementById("hobbies").value = userInteracted ? "1" : "0";
document.getElementById("hobbies").value = userInteracted ? "true" : "false";
const form = e.target;
const zsrNummer = form.elements['zsr_nummer'].value;
@ -39,6 +41,12 @@ window.onload = function () {
const data = new FormData(form);
const notification = document.getElementById('notification');
const btn = document.getElementById('bestellformular-btn');
console.log("userInteracted: " + userInteracted);
console.log("timeSpent: " + timeSpent);
console.log("hobbies: " + document.getElementById("hobbies").value);
console.log("age: " + document.getElementById("age").value);
console.log("verify_email: " + honeyPot);
fetch(form.action, {
method: 'POST',
mode: 'cors',