You are assigning a value to $path twice.
PHP Code:
// directory name sent by url
$dir = $_GET['dir'];
$path = $_SERVER['DOCUMENT_ROOT'].''.$dir;
$file = $_GET['file'];
//define the path as relative
$path = $dir."".$file;
The path you use to open and read the directory needs to be the server path and cannot contain a file name.
PHP Code:
$server_path = $_SERVER['DOCUMENT_ROOT'].'/Art/Panama_Feb_2007/'.$dir;
opendir($server_path);
The path you use for HTML is different.
PHP Code:
$url_path = '/Art/Panama_Feb_2007/'.$dir;
echo '<img src="'.$url_path.'" border="0">';
Also, when you concatenate two variables you don't need the empty quotes in between.
PHP Code:
$variable = $value1.$value2;
Bookmarks