So I\'ve got a basic .ajax() POST method to a PHP file.
What security measures do I need?
A few posts around were mentioning using a hidden MD5 input field t
Here's a simple demo you can try with django:
On HTML page
{%block content%}
{%endblock%}
Java-Script Code
%(document).on('submit','#userForm',function(e){
e.preventDefault();
$.ajax({
type = 'POST',
url:'path/to/url',
data:{
username:$('#username').val(),
password:$('#password').val(),
csrfmiddlewaretoken:$('input[name=csrfmiddlewaretoken').val()
},
success:function(data){
alert('Successfull');
}
});
});