prova aggiungendo apici singoli a $catSel:
e lascia header ("Content-type: ".$type);Codice PHP:
$sql = "SELECT foto_id,foto_nome,foto_size,foto_type, foto, foto_cat,foto_naz FROM img WHERE foto_cat = '".$catSel."' ORDER BY RAND() LIMIT 2";
p.s. i tag per il php sono PHP non CODE