Ciao a Tutti,
sto utilizzando uno script di una galleria fotografica e succede che quando inserisco una foto non mi permette la visualizzazione della stessa.
In effetti se mi porto con la freccetta sulla miniatura mi da come link:
Codice PHP:
<a id="pirobox_gall" class="zmadho first last" href="fotot/galeria/plot/galeria32229203311726" rel="1of1" rev="0"/> 
in realtà dovrebbe essere :
Codice PHP:
<a id="pirobox_gall" class="zmadho first last" href="fotot/galeria/plot/galeria32229203311726.jpg" rel="1of1" rev="0"/> 
il codice che scrive il database è questo
Codice PHP:
<?php session_start(); ob_start(); if(!isset($_SESSION['admin'])) { header('Location: hyrja'); exit(); } include('mjetet/ldb.php'); 

            
$destinacioni="galeria";
            
            
//vendi ku do t&euml; rruhen imazhet
            
$paravendi "../fotot/".$destinacioni."/para/";
            
$plotvendi "../fotot/".$destinacioni."/plot/";
            
            
//A d&euml;shironi ti limitoni ekstenzionet e ngarkimit ? (po/jo)
            
$kufizimitipit "po"
            
            
//Ekstenzionet e lejuara
            
$tipetelejuara = array(".gif",".jpg",".png",".jpeg",".bmp");
            
            
// ruajm informacionet e t&euml; dh&euml;n&euml;s p&euml;rkoh&euml;sisht
            
$tipiitedhenes $_FILES['imazhi']['type'];
            
$emriitedhenes $_FILES['imazhi']['name'];
            
$masaetedhenes $_FILES['imazhi']['size'];
            
$edheneperkohshme $_FILES['imazhi']['tmp_name'];
            
            
//kontrollojme se a &euml;sht&euml; ngarkuar ndonj&euml; t&euml; dh&euml;n&euml;
            
if(!is_uploaded_file($edheneperkohshme)){
            
$mesazhi="Error: Please choose a picture!.";
            } else {
            
            
//kontrollojm&euml; ekstenzionin
            
$ekst strrchr($emriitedhenes,'.');
            
$ekst strtolower($ekst);
            if ((
$kufizimitipit == "po") && (!in_array($ekst,$tipetelejuara))) {
            
$mesazhi="Choosen Picture isn't allowed.";  } }
            
            
//marrim prapashtesen.
            
$merrekst explode ('.'$emriitedhenes);
            
$ekstitedhenes $merrekst[count($merrekst)-1];
            
            
//definojm&euml; emrin e rast&euml;sish&euml;m
            
$emri_irastit md5(time());
            
$emri_irastit"".$destinacioni."".rand(0,999999999999999)."";
                
            
// caktojm masat se sa do t&euml; jen p&euml;r proporcionim t&euml; automatizuar
            
$paramasaGJ160;
            
$plotmasaGJ800;
            
$paramasaL115;
            
$plotmasaL600;
            
            
//rruajm formen e imazhit
            
if($masaetedhenes){
            if(
$tipiitedhenes == "image/pjpeg" || $tipiitedhenes == "image/jpeg"){
            
$imazhiri imagecreatefromjpeg($edheneperkohshme);
            
$imazhiri2 imagecreatefromjpeg($edheneperkohshme);
            }elseif(
$tipiitedhenes == "image/x-png" || $tipiitedhenes == "image/png"){
            
$imazhiri imagecreatefrompng($edheneperkohshme);
            
$imazhiri2 imagecreatefrompng($edheneperkohshme);
            }elseif(
$tipiitedhenes == "image/gif"){
            
$imazhiri imagecreatefromgif($edheneperkohshme);
            
$imazhiri2 imagecreatefromgif($edheneperkohshme);
            }
            
            
//tani vendosim p&euml;r p&euml;rmasat e reja
            
list($gjeresia$gjatesia) = getimagesize($edheneperkohshme);
            if (
$gjatesia $gjeresia ) {   
                     
$zmadho $paramasaGJ $gjatesia;  
                     
$gjatesiaere $paramasaL;   
                     
$gjeresiaere $gjeresia $zmadho;   
                  } else {    
                    
$zmadho $paramasaGJ $gjeresia;   
                    
$gjeresiaere $paramasaGJ
                    
$gjatesiaere $gjatesia $zmadho;
                  } 
            if (
$gjatesia $gjeresia) {   
                     
$zmadho $plotmasaGJ $gjatesia;  
                     
$gjatesiaere2 $plotmasaL;   
                     
$gjeresiaere2 $gjeresia $zmadho;   
                  } else {    
                    
$zmadho $plotmasaGJ $gjeresia;   
                    
$gjeresiaere2 $plotmasaGJ
                    
$gjatesiaere2 $gjatesia $zmadho;
                  } 

            
            
//funksioni i rizmadhimit
            
if (function_exists(imagecreatetruecolor)){
            
$imazhirizmadhuar imagecreatetruecolor($gjeresiaere,$gjatesiaere);
            
$imazhirizmadhuar2 imagecreatetruecolor($gjeresiaere2,$gjatesiaere2);
            }else{
            die(
"Error: Please ask your hoster to support higher GD library as GD2.");
            }
            
imagecopyresampled($imazhirizmadhuar$imazhiri0000$gjeresiaere$gjatesiaere$gjeresia$gjatesia);
            
imagecopyresampled($imazhirizmadhuar2$imazhiri20000$gjeresiaere2$gjatesiaere2$gjeresia$gjatesia);
            
//ruajm imazhet
            
ImageJpeg ($imazhirizmadhuar,"$paravendi/$emri_irastit.$ekstitedhenes",100);
            
ImageJpeg ($imazhirizmadhuar2,"$plotvendi/$emri_irastit.$ekstitedhenes",100);
            
ImageDestroy ($imazhirizmadhuar);
            
ImageDestroy ($imazhirizmadhuar2);
            
ImageDestroy ($imazhiri);
            
ImageDestroy ($imazhiri2);
            
            
//postojm&euml; informacionet n&euml; databaz&euml;
            
$d_to_dt "INSERT INTO galeria VALUES('','".$emri_irastit.".".$ekstitedhenes."')";
            
$get_rmysql_query($d_to_dt,$lidhja) or die (mysql_error($lidhja));
            
$mesazhi="
Picture has been uploaded!
<a href=\"shfleto.php\">go back to browse</a>


"
; }
            
?>