Scanning $path for images.
"; if ($subdir) { echo "found the following al_images:
"; } } function GetDirArray($path) { global $db; $dir = opendir($path); $path .= "/"; echo "Scanning ",$path,"
"; if ($dir) echo "
Found the following al_directories:"; { while ($file = readdir($dir)) { if (is_dir($path.$file) && $file != "." && $file != "..") { echo "
>>",$file,""; $result=mysql_query("SELECT * FROM al_directories WHERE folder='$file'",$db); $myrow=mysql_fetch_row($result); if (!$myrow) { echo "...no entry in the database for $file."; $ret_dir[] = $file; $sql="INSERT INTO al_directories (folder) VALUES ('$file')"; $write=mysql_query($sql); GetFileArray($path.$file,$file); } } } closedir($dir); echo "
"; } } $db=mysql_connect("localhost","ed","photo"); mysql_select_db("album",$db); if (isset($rebuild)) { $sql="DELETE FROM al_directories"; $write=mysql_query($sql); $sql="DELETE FROM al_images"; $write=mysql_query($sql); } if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "69")) { header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else { echo "

You're authorized!

"; } } GetDirArray("/home/httpd/vhosts/larrosas.com/httpdocs/album/images"); ?>

Photo Album database has been rebuilt.

Click here to view the photo album or you can rebuild the database from scratch by clicking here