I am trying to send an XML file from a textfield in my html, via ajax to a PHP file. This is the almighty PHP file:
<?php
$data = urldecode($_POST["xml"]);
echo $data;
?>
Data is sent to this file as such:
$("#btn_save").click(function() {
var data = escape($("#textfield").text());
alert(data);
$.ajax({
url: "validate.php",
method: "POST",
data: "xml=" + data,
complete: function(e) { alert(e.responseText); }
});
});
Now, as long as I don't sent more than a few lines of code, it works as it should. When I paste in a 60 line XML file however, validate.php returns
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /xml_stylist/form/validate.php
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at dahwan.info Port 80</address>
</body></html>
What am I doing wrong?
Thanks