Hi
I have tried to build an installer for my codeigniter application and after completing af small form for collecting the database information it should execute a method for setting everything up.
This function is located in the install controller and the method is called runci and takes no arguments.
Currently looks like this:
PHP Code:
$data = array(
'status' => 'OK',
'http_response' => 200,
'message' => 'JSON data recieved'
);
return json_encode($data);
My JS looks like this and is written in-line at the bottom of my view-file:
Code:
//AJAX call to submit and install
$(document).ready(function(){
var formdata = <?php print json_encode($_POST); ?>;
console.log(formdata);
try {
$.post('<?php print site_url(); ?>install/runci', formdata);
}
catch(e) {
console.log(e);
}
});
HTML output is correct, but after outputting the formdata to the console and then posting, I get this error back in the console:
Code:
POST http://ignitercms.khit.dev/install/runci 500 (Internal Server Error)
I know that something is wrong, but I cannot see what.
Only change from default CI 2.2.1 is that I have added wiredesignz HMVC Modular Extentions