php getting a error message looked on the internet but nothing error message below?

ganger

New member
Notice: Undefined index: album in C:\wamp\www\photoalbum\album.php on line 18

program works just dont want the error message and want to know why it appears and how to solve it

line 18 is $get_album = $_GET['album'];

full code below
<html>
<head>
<script type="text/javascript" src ="lightbox.js"></script>
</head>
<body>
<?php
$page = $_SERVER['PHP_SELF'];

// setting
$column = 2;

// directories
$base = "data";
$thumb = "thumbs";

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

if (!$get_album)
{
echo "<b>Selct an album: </b> <p />";
$handle = opendir ($base);
while(($file = readdir($handle))!==False)
{
if (is_dir($base."/".$file) && $file != "." && $file != ".." && $file != $thumb)
{
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/$thumb/$file' height='100' width '100'></a></td></tr>";
$x++;
if ($x ==$column)
{
echo "<br />";
$x =0;
}

}
}
closedir($handle);
}
}
echo "<p /><a href=''$page>back to albums</a>";
?>
</body>
</html>
 
Back
Top