make it POST request LOCALHOST WORKING FULLY BUT LIVE>>>> ERROR // IS IT PHP 7 OR PHP PROBLEM ON SERVER OR … IS CODEIGNITER INSTALLATION ERROR IN PARENT FOLDER?
jquery.js:8706 POST http://www.bestofficedesksetup.com/SudokuSolver/ajax-processor.php **500 (Internal Server Error)**
http://www.bestofficedesksetup.com/SudokuSolver/index.html
http://www.bestofficedesksetup.com/SudokuSolver/ajax-processor.php
LOCALHOST IS OK BUT live error see attachments — is it .htaccess or codeigniter in parent folder install ???
<?php
ini_set('display_errors', '1');
ini_set("max_execution_time",35 ); //you can use this if you know your script should not take longer than 15 seconds to finish
register_shutdown_function('shutdown');
//var_dump(json_decode($_POST["data"]));
//echo ($_GET["c00"]);
//die();
define("N", 9);
define("UNASSIGNED", 0);
$grid = [];
$arr = json_decode($_POST["data"], true); // true for getting array Not obj
for($i=0; $i<9; $i++) :
for($j=0; $j<9; $j++) :
$grid[$i][$j] = $arr["c".$i."".$j];
endfor;
endfor;
Show us the JavaScript that you use to call the PHP code. The error message is complaining that it can’t find an array member called 'data' in an array somewhere.
Note that in my sample code above for calling the PHP code, my variables arrived in $_POST['c0'], $_POST['c1'] and so on, there was no need to call JSONDecode to get them out.
ETA - Oh, I see it now, I didn’t use JSON.stringify above, just passed the array in and it was automatically dealt with.
again … localhost post and sudoku working fully ok
provided half php code
the the urls // IF WORKED THESE ARE NOT SUPPORTED GETTING THE SAME OUTPUT??? BUT NOT SEE SHOTS / PICTURES — NOT NEEDED ALL CODE HENCE LOCALHOST WORKING BUT LIVE NOT… MUST BE ERROR WITH PHP ON SERVER OR .HTACCESS OR PARENT FOLDER… CODEIGNITER INSTALLATION…