appreciation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear everybody :-)

I wanted to thank everyone for helping me out on the stuff that I had been 
trying to do in the last couple weeks. I know I was unorganized, confused, 
flustered and burnt out. But after all the feedback, and getting a swift kick 
in the arse from Jim and Govinda telling me not to let anyone intimidate me, 
and quite a few other good points, I went back to my original plan and used 
opendir. After I got this down and understood it, It made me realize how glob 
worked and I wrote the same thing using glob as I did with opendir. I feel 
good about this and what's even better, I killed 2 birds with 1 stone.. LOL 
Anyway, I just wanted to let everyone know I appreciated all the feedback. :-)

<!-- using opendir-->
$page = $_SERVER['PHP_SELF'];

//directories
$dirBase = "images/property_pics";


//get album
$get_the_album = $_GET['album'];

if (!$get_the_album){
echo "<p />Select an album:<p />";
$handle = opendir($dirBase);
while(($file = readdir($handle)) !==FALSE){
if(is_dir($dirBase."/".$file) && $file != "." && $file != ".."){
echo "<a href='$page?album=$file'>$file</a><br />";
}
}
closedir($handle);
}
else{

if(!is_dir($dirBase."/".$get_the_album) || strtr($get_the_album, ".") !=NULL 
|| strtr($get_the_album, "\\") !=NULL){
echo "Album does not exist.";
}


else {

// echo "$get_the_album";
$handle = opendir($dirBase. "/" . @$get_the_album);
while(($file = readdir($handle)) !== FALSE){
if ($file != "." && $file != ".."){


echo "<div id='imageStack'><a href='$dirBase/$get_the_album/$file' 
rel='lightbox[image]'><img src=$dirBase/$get_the_album/$file height='150' 
width='150'></a><br /></div>";

}
}
closedir($handle);
}

}

<!--end of using opendir-->

<!start of using glob-->
function myglob(){
  
  $result = mysql_query("SELECT * FROM properties");
        while($row = mysql_fetch_array($result)){
         $MLS_No = $row['MLS_No'];          
          }
      $images = glob('images/property_pics/' .$MLS_No.'/*');
      foreach ($images as $image){
      echo "<div id='imageStack'><a href='$image' rel='lightbox[MLS_No]'><img 
src='$image' width='200' height='200'></a></div>";
  }
}
<!--end of using glob-->
-- 
David M.


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux