jquery - ajax post to php returns $_SERVER['REQUEST_METHOD'] GET -
i'm trying post newsletter form data php
page ajax
when echo $_server['request_method']
on php
page prints get
(with no variables). have used similar code on multiple websites no problems. (jquery v3.2.1
)
$.ajax({ method: 'post', datatype: 'json', url: '<?=$site_url?>/templates/xxxx/contact_send/email_send.php', data: json.stringify(datastring), contenttype: 'application/json;charset=utf-8', success: function () { console.log('success'); } });
network log
echo $_server['request_method']
response
browser of method get....(second image)
you should see network log image response
Comments
Post a Comment