Salve ragazzi come da titolo sto costruendo una galleria fancybox che in base all'utente mi carichi tutte le immagini da un database e me le mostrin in modalità "galleria" (un pò come avviene su facebook)
sostanzialmente ad ogni immagine associo un "onclick=getimage(userid);"
questa è la funziona getimage
codice:
function getimage(id) {
$.ajax({
type: "GET",
dataType: "json",
url: 'getimages.php',
data:'user='+id,
success: function(data){
$.fancybox([data.output], {
'padding': 0,
'transitionIn': 'none',
'transitionOut': 'none',
'type' : 'image',
'changeFade' : 0,
'topRatio' : 0.2
});
}
});
return false
}
mentre questa è la pagina in php che effettua la risposta
Codice PHP:
<?
include 'config.php'; connect(); session_start();
$user = trim(strip_tags($_GET['user']));
$qstring = "SELECT url as output FROM post WHERE user_id = '$user' AND type = 'photo'";$result = mysql_query($qstring);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $row['output']= $row['output']; $row_set[] = $row;}echo json_encode($row_set);
?>
il risultato è The requested content cannot be loaded.Please try again later.
non capisco proprio dove sbaglio... aiuto