How could this variable be passed to php, since I need it to make sql queries to a server.
Resolved
I sent via the fetch api, with POST the variable:
fetch('./php/views/certificacion_afiliacion_trabajador.php', {
method: 'POST',
body : JSON.stringify({'cedula': cedu}),
}).then(res => res.json())
}).then(data => {
console.log(data);
});
Php did not receive the data, with $ _POST, so I used this command to receive it
print_r(json_decode(file_get_contents("php://input")));
Thank you very much for your answers, they helped me to solve my doubt