I have recently been learning how to code a photo gallery in php, that doesnt use a database. But i have come up against some problems. Whilst coding in dreamweaver it came up saying that there was an error on line 26 of the code which i have put an * against so you know which line it is. I cannot seem to see where i have gone wrong.
<html>
<head>
<script type="text/javascript" src"lightbox.js"></script>
</head>
<body>
<?php
$page = $_SERVER['PHP_SELF'];
//settings
$column = 5;
//directories
$base = "data";
$thumbs = "thumbs";
//get album
$get_album = $_GET['album'];
if(!$get_album)
{
echo "<b>Select an Album</b><p />";
$handle = opendir($base);
while (($file = readdir($handle))!==FALSE)
{
if (is _dir($base."/".$file) && $file != "." && $file != ".." && $file != $thumbs)
{
echo "<a href='$page?album=$file'>$file</a><br />";
}
}
closedir($handle);
}
else
{
* if (!is_dir($base."/".$get_album) || strstr($get_album,".")!=NULL || strstr($get_album,"/")!=NULL ||strstr($get_album,"\\")!=NULL)
{
echo "Album doesn't exist.";
}
else
{
$x = 0;
echo "<b>$get_album</b><p />";
$handle = opendir($base."/".$get_album);
while (($file = readdir($handle)) !==FALSE)
{
if ($file != "." && $file !="..")
{
echo "<table style='display:inline;'><tr><td> <a href='$base/$get_album/$file' rel='lightbox'><img src='$base/$thumbs/$file' height='100' width='100'></td></tr></table>";
$x++;
if ($x==$column)
{
echo "<br />";
$x = 0;
}
}
}
closedir($handle);
echo "<p /><a href='$page'>Back to Albums</a>";
}
}
?>
</body>
</html>
Cheers in advance guys for any help
Ryan
<html>
<head>
<script type="text/javascript" src"lightbox.js"></script>
</head>
<body>
<?php
$page = $_SERVER['PHP_SELF'];
//settings
$column = 5;
//directories
$base = "data";
$thumbs = "thumbs";
//get album
$get_album = $_GET['album'];
if(!$get_album)
{
echo "<b>Select an Album</b><p />";
$handle = opendir($base);
while (($file = readdir($handle))!==FALSE)
{
if (is _dir($base."/".$file) && $file != "." && $file != ".." && $file != $thumbs)
{
echo "<a href='$page?album=$file'>$file</a><br />";
}
}
closedir($handle);
}
else
{
* if (!is_dir($base."/".$get_album) || strstr($get_album,".")!=NULL || strstr($get_album,"/")!=NULL ||strstr($get_album,"\\")!=NULL)
{
echo "Album doesn't exist.";
}
else
{
$x = 0;
echo "<b>$get_album</b><p />";
$handle = opendir($base."/".$get_album);
while (($file = readdir($handle)) !==FALSE)
{
if ($file != "." && $file !="..")
{
echo "<table style='display:inline;'><tr><td> <a href='$base/$get_album/$file' rel='lightbox'><img src='$base/$thumbs/$file' height='100' width='100'></td></tr></table>";
$x++;
if ($x==$column)
{
echo "<br />";
$x = 0;
}
}
}
closedir($handle);
echo "<p /><a href='$page'>Back to Albums</a>";
}
}
?>
</body>
</html>
Cheers in advance guys for any help
Ryan