Using .htaccess 












Using .htaccess/.htpasswd Password Protection 





Coding Tips 








Uploads and Downloads 



Mail 
see it on this page





Working with Images 


Frequently Requested Website Functionality 
see it on this page
see it on this page
see it on this page
see it on this page











Using PHP 




Website Managment 








Other Tips 









Photo Album
This is a basic photo album script. You see the first photo and then click through them. If you want something simple, no flash, this may be it. There are some restrictions. It uses the file name as the photo description, but it cannot have single quotes in the name. And all the photos should be the same size to make it look right. You can make adjustments to the size and html layout in the code.
<?php
// the file name text is used as the description
// the file name cannot contain single quotes or the code will not work
$directory = "./"; // relative path to the directory with the image files
$imageArray = glob($directory.'*.jpg');
$number = count($imageArray)-1;
?>
<script type="text/javascript">
<?php
echo "var images = new Array(";
foreach($imageArray as $file) {
if ($switch) echo ",";
$switch = true;
echo "'".$file."'";
}
echo ");";
echo "albumCount = ".$number.";";
echo "directoryLength = ".strlen($directory).";";
echo "subtractLength = ".strlen($directory)."+4;";
$firstImage = $imageArray[0];
$firstText = substr($imageArray[0],strlen($directory),strlen($imageArray[0])-strlen($directory)-4);
?>
count = 0;
function next() {
count++;
if (count > albumCount) count = 0;
display();
}
function back() {
count--;
if (count < 0) count = albumCount;
display();
}
function display() {
document.getElementById('pic').src = images[count];
document.getElementById('picText').innerHTML = images[count].substr(directoryLength,images[count].length-subtractLength);
}
</script>
<div style="position: relative; margin: 0px auto; border: solid black 1px; background: #EEEEEE; padding: 10px; text-align: center; width: 600px;">
Slideshow of Photos<br /><br />
<div style="margin: 10px 0px 10px 0px; position: relative; text-align: left; width: 600px; height: 400px; border: solid 1px black;">
<img src="<?php echo $firstImage; ?>" id="pic" style="height: 400px; width: 600px;" alt="" title="" />
<div id="picText" style="position: absolute; bottom: 0px; left: 0px; background: black; color: white; font: normal 12px/22px Arial, sans-serif; overflow: hidden; text-indent: 10px; width: 100%; height: 22px; opacity: .6;">
<?php echo $firstText; ?>
</div>
</div>
<img src="left.gif" style="cursor: pointer; border: none;" alt="back" title="" onclick="back();" />
<img src="right.gif" style="cursor: pointer; border: none;" alt="forward" title="" onclick="next();" />
</div>
