If your main page resides in:
http://somedomain.com/~dir/
and the image directory is:
http://somedomain.com/~dir/images/
did you try the following:
$imagestmp = './images/' . $listnum . 'a.jpg';
if (file_exists($imagestmp) ) {
$image = $imagestmp;
} else {
$image = '.images/notavail.jpg';
}
if you need to go back another directory you would
$imagestmp = './../images/' . $listnum . 'a.jpg';
if (file_exists($imagestmp) ) {
$image = $imagestmp;
} else {
$image = './../images/notavail.jpg';
}
or to simplify you might
$imageDir = './images/';
// $imageDir = './../images/';
$imageExt = 'a.jpg';
$imagestmp = $imageDir . $listnum . $imageExt;
if (file_exists($imagestmp) ) {
$image = $imagestmp;
} else {
$image = $imageDir . 'notavail.jpg';
}
This is untested, but might be worth a try,
Geoffrey