I have a thumb generator script that need me to use define to indicate the path of the folder … I’m picking a it from a mySQL fild in the form of /images/galleries/name/imagem.jpg
I think I’m doing this the noob way … there must be a better way of doing this!
while($r3 = mysql_fetch_array($e3)){
$path = $r3['pathURLMult'];
$ped = explode("/", $path);
$path2 = $ped[0] . "/" . $ped[1] . "/" . $ped[2] . "/";
define("FOLDER_IMAGES","$path2");
$imagem = $ped[3];
echo "<img src=\"getimage.php?img=$imagem&w=280&h=180\" width=\"280\" height=\"180\" />";
}
Can someone help ? Thanks in advance
Use pathinfo();
Try this: