I have migrated my website to a different domain. Everything was working until the migration. Now my JSON POST Function returns nothing, its like the file doesnt exists. No code has been changed just the actual URL of the website.
$.ajax({
url:"/wp-content/themes/atex-assembly/grp-enclosure-122x120x90/load.php",
method: "post",
data: { loadDump: JSON.stringify( loadDump )},
success: function(data){
wp_send_json_error( 'Error: Invalid data!' );
console.log(data);
var ArrayReturn = JSON.parse(data);
console.log(ArrayReturn);
window.localStorage.setItem('ArrayReturn', JSON.stringify(ArrayReturn));
window.localStorage.setItem('loadDumpStore', JSON.stringify(loadDumpHash));
console.log(localStorage);
window.location.hash = loadDumpHash;
window.location.reload();
}
})
});
load.php
require_once("/kunden/homepages/41/d753118124/htdocs/atex-assembly/wp-
load.php");
global $wpdb;
global $current_user;
// //Get the string from front end to match against database for query
$loadDump = wp_unslash( $_POST['loadDump'] );
$loadDumpDecode = json_decode( $loadDump );
$table_name= $wpdb->prefix. 'product_configurator';
$DBP_results= $wpdb->get_results("SELECT * FROM $table_name WHERE
keymap_key = '$loadDumpDecode'");
$DBP_current_user = get_current_user_id();
foreach($DBP_results as $DBP_cols){
$user_id= $DBP_cols->user_id;
$enclosure_type= $DBP_cols->enclosure_type;
$keymap_key= $DBP_cols->keymap_key;
$key_map_loaded= json_decode($DBP_cols->key_map);
}
echo json_encode($key_map_loaded);