Building a website for my kid's bday which will allow his grandparents to log on and click through 15gigs worth of pics/vids from every day of the last two years. Can't seem to capture any data from my PHP program in jQuery however. AND I keep receiving an error that reads: "Failed to load resource: net::ERR_EMPTY_RESPONSE (03:27:54:409 | error, network at public_html/pics/desi/desiPics.php". I thought the procedure was relatively simple. Am I overcomplicating it somehow?
From desiPics.php:
<?php
$dir= glob('pics/desi/{*.jpg,*jpeg,*png,*gif}', GLOB_BRACE);
echo json_encode($dir);
?>
From jQuery:
var desiPics = [];
$.ajax({
type: 'POST',
url: 'pics/desi/desiPics.php',
cache: false,
async: true,
success: function(result){
if(result){
desiPics = eval(result);
alert(desiPics.length);
}else{
alert('error');
}
}
});