Question about php coding

Associate
Joined
21 Jun 2011
Posts
16
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
 
It just says that there is a syntax error on line 26, and that code hinting may not work until you fix this error. When i embed the file into another php document and upload it to my web domain it is just blank and shows nothing what so ever
 
Cheers immsy, been looking at it for an age and didnt even clock it lol, and as regards to the * it was meant to go on line 26 but i obviously pasted it in the wrong place :( fail lol, all sorted and working now though so cheers :D
 
Yeah working in dreamweaver and the only problem is that i am colour blind mate lol, so i can see that its different colours but just not tell properly what they are =/ lol
 
Back
Top Bottom