try a little something like this
<?
include('top.php');
include('left.php');
include('dbinfo.inc.php');
?> <td width="81%"> <?
$kind = $HTTP_GET_VARS['kind'];
$dir = '/home/user/www/'.$kind.'/'; //this should be a better path
if($fd = opendir($dir)){ //any time you can, always test to make sure an operation completed successfully
while (False !== ($image=readdir($fd))){
$query = mysql_query("SELECE * FROM auto WHERE kind='$kind'") or die(mysql_error());
$url = mysql_fetch_assoc($query) or die(mysql_error());
$link = $url['stockid'];
$year = $url['year'];
$make = $url['make'];
$model = $url['model'];
echo "<a href='show.php?stockid=$link'><img src='$image' width='100' height='100' /><br> $year $make $model </a>";
}
} else {
echo 'failed to open dir';
}
?>
</td>
<? include('bottom.php'); ?>