I have a php page called form.php. When you go to this page it shows a form, when that form is submitted I have jquery code that posts the form to itself via ajax. This works for other pages, however this specific page/code is giving me a 403 error when the page is submitted. The main difference is the other pages that work are located in a sub folder while form.php is in the root directory. Here is the jquery code:
$.ajax({
type:'POST',
cache:false,
url:'/form.php?action=add',
data:formData,
dataType:'json',
success: function(data) {})
});
I understand this is a server error, my question is why would it fail pointing to itself via the root folder but not fail if posted to a page in a sub folder?
Ok I figured it out. One of the fields I was storing 2 variables in one value like so:
1<>2
I guess the <> part was triggering some issues, once I removed that it worked without any issues. Thanks everyone for the help!