Почему я сталкиваюсь с 409 ошибкой конфликта < /p>
Я работаю над формой карьеры для отправки данных веб -сайта в Gmail.
Все прекрасно сделаны. Я делаю свой код в прямом эфире в CPanel, он будет прекрасно работать на моем ПК, и когда я использую другое устройство для заполнения данных и отправки моего кода, в консоли показать мне ошибку конфликта 409. < /p>
< /code>
// toastr.options = {
// positionClass: 'toast-top-right',
// timeOut: 3000,
// };
$(document).ready(function () {
$('#form').on('submit', function (event) {
// Example JavaScript code to disable submit button
this.disabled = true;
event.preventDefault(); // Prevent default form submission
// Perform client-side validation
let isValid = true;
const name = $('#name').val().trim();
const email = $('#email').val().trim();
const phone = $('#phone').val().trim();
const experience = $('#experience').val();
const resume = $('#file').val();
// Clear previous toastr messages
toastr.clear();
if (document.getElementById("name").value == "") {
// result.innerHTML = "Please Enter Your Name...";
toastr.error("Please Enter Your Name...");
isValid = false;
} else if (document.getElementById("email").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Email...");
isValid = false;
}
else if (!validateEmail(email)) {
toastr.error('Invalid Email Address.');
isValid = false;
}
else if (document.getElementById("phone").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Phone Number...");
isValid = false;
} else if (!/^\d{10}$/.test(phone)) {
toastr.error('Phone Number must be 10 digits.');
isValid = false;
} else if (experience.value == "") {
toastr.error("Please Select Your Work Experience.");
isValid = false;
}
else if (document.getElementById("file").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Upload Your CV...");
isValid = false;
}
// If validation passes, proceed with AJAX submission
if (isValid) {
const formData = new FormData(this);
$.ajax({
url: 'mail.php', // The PHP script that processes the form
// url: 'https://formbold.com/s/3Kr4p',
type: 'POST',
data: formData,
processData: false, // Prevent jQuery from converting the data
contentType: false, // Prevent jQuery from overriding the content type
success: function (response) {
console.log(response, "done");
toastr.success('Form submitted successfully!');
$('#form')[0].reset(); // Reset the form
},
error: function () {
toastr.error('An error occurred while submitting the form.');
},
});
}
});
// Helper function to validate email format
function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}
});
< /code>
< /code>
It will work perfectly in my pc and when i use another device to fill the data and submit my code then , in console show me the 409 conflict error.
Подробнее здесь: https://stackoverflow.com/questions/794 ... lict-error
Почему это не работает для другого пользователя, как исправить ошибку конфликта 409 для другого пользователя, поэтому он ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение