Answer the question
In order to leave comments, you need to log in
Why is php code not working when submitting ajax form?
<script type="text/javascript">
(function($){
$(function(){
//Нажата кнопка submit
$("#free-form").submit(function() {
var data = $("#free-form").serialize();
$.ajax({
//путь до обработчика php. Валидация и отправка EMail
url: "/wp-content/themes/law/mail.php",
type: "POST",
//данные
data: data,
cache: false,
success: function (html) {
$('#free-form').hide();
$('#result').append('Спасибо, ваше сообщение отправлено!');
}
});
return false;
});
});
})(jQuery)
</script>
if (isset($_POST['submit-free'])){
update_option('sumpull',++$sumpull);}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question