2024-07-22 15:37:47 +02:00
|
|
|
function inscription(){
|
|
|
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
|
|
|
formData.append("username",document.getElementById("username-input").value);
|
|
|
|
formData.append("password",document.getElementById("password-input").value);
|
2024-08-10 16:22:21 +02:00
|
|
|
console.log(document.getElementById("insa-input").value);
|
|
|
|
formData.append("nom_insa",document.getElementById("insa-input").value)
|
2024-07-22 15:37:47 +02:00
|
|
|
formData.append("jeton-csrf",jeton_csrf);
|
|
|
|
|
|
|
|
fetch('api.php/inscription', {
|
|
|
|
method: 'POST',
|
|
|
|
body: formData
|
|
|
|
})
|
2024-07-22 17:55:09 +02:00
|
|
|
.then(response => response.json())
|
2024-07-22 15:37:47 +02:00
|
|
|
.then(data => {
|
2024-08-15 23:57:12 +02:00
|
|
|
alert(data.msg);
|
2024-07-22 15:37:47 +02:00
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
console.error('Error:', error);
|
|
|
|
});
|
|
|
|
}
|