Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Avoid POST data escaping
#3

I cancelled my overide of Input class to get the POST data with native PHP $_POST["xml"], but I had still the same message "Disallowed Key Characters." ! So I checked DB classes but couldn't find this message in code.

The Controller is now like this :

PHP Code:
public function saveXML()
{
    
$xml $_POST['xml'] ? $_POST['xml'] : null;
    if(!
is_null($xml))
        return 
$this->instru->setXML("4""model"$xml);


@Rufnex : Thanks for your answer, I tried it but nothing happened so I added the error handler to AJAX and it's on error.

Here is the AJAX

Code:
$.ajax({
    type: "POST",
    url: "<?php echo base_url('instructions/saveXML'); ?>",
    data: "xml=" + xml,
    contentType: "text/xml",
    dataType: "xml",
    success: function (resp) {
        alert(resp);
    },
    error: function() {
        alert("error");
    }
});

I don't think I messed up with the model so I can't figure it out... I will continue to investigate.
Reply


Messages In This Thread
[SOLVED] Avoid POST data escaping - by _this - 12-19-2014, 01:36 AM
RE: Avoid POST data escaping - by Rufnex - 12-19-2014, 02:27 AM
RE: Avoid POST data escaping - by _this - 12-19-2014, 03:07 AM
RE: Avoid POST data escaping - by _this - 12-19-2014, 03:34 AM
RE: Avoid POST data escaping - by Rufnex - 12-19-2014, 03:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB