When I open this new javascript window, I use a location.href tag to guide it to the variable $path, the only problem is that it always adds another slash into the path eg: C:\Digiphotos\PIC1.JPG
Here is my code:
<?php
$dirname = "C:\\Digiphotos";
$dir= opendir($dirname);
while ( false!= ($file2 = readdir($dir) ) )
{
if ( ($file2 != ".") and ( $file2 != "..") )
{
$dirname = "C:%5CDigiphotos";
$fullpath="$dirname%5C$file2";
$file_list2 .= "<input type='button' class='view' onClick=\"window.open('viewfile.php?path=$fullpath')\" ><img src='spacer.gif' width='10' height='10' border='0'>$file2<br>";
}
}
closedir($dir);
echo($file_list2);
?>
Thanks in advance!