I am trying to access post information in php file, but I clearly cannot find a way how to do it since I do not enter the if statement:
php code:
<?php
if(isset($_POST["submit"])){
var_dump($_POST);
}
exit();
js code:
const name = document.getElementById("name").value;
const formData = new FormData();
formData.set("name", name);
formData.set("submit", "submit");
fetch('./includes/index.inc.php', {
method: 'post',
body: formData
})
.then(function(res){ return res.text })
.then(function(text){console.log(text)})
.catch(function(res){ console.log(res) })
Does service worker play a role here?