In a .php page I have the function below. In localhost the JSON response is different than NULL, but when I put the page in on the server (FTP) the JSON response is NULL.
THE CODE
// Check for required parameters
if (isset($_POST["placetype"]) && isset($_POST["placeName"])) {
$pt = $_POST["placetype"];
$pn = $_POST["placeName"];
$dir = 'Pictures/Attractions/'.$pt.'/'.$pn.'/';
$files = scandir($dir);
foreach($files as $ind_file) {
$result[] = array(
"data" => $ind_file
);
sendResponse(200, json_encode($result));
return true;
}//ifisset
sendResponse(400, 'Invalid request');
return false;
Note: the same folders are on both local and on the server.
Thanks.