Hi
I am trying to get the contents of a dir on my local pc. When I run the script locally I get the correct results. When I run the script from my isp I get the contents of the root folder where the script is.
<?php
if (isset($_POST['Submit']) && ($_POST['Submit'] == "Test Folder")) {
echo "path = " . $this_dir = stripslashes($_POST['txt_fileName']); // <<< used on server
// echo "path = " . $this_dir = $_POST['txt_fileName']; // <<< used on local pc
echo "<br>";
echo "dir = " . $get_dir = dirname($this_dir);
$d = dir("$get_dir");
while (false !== ($entry = $d->read())) {
if (substr($entry, 0, 1) == '.') continue;
$files[] = $entry;
}
$d->close();
echo "<pre>";
print_r($files);
echo "</pre>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="testftp.php" method="post" enctype="multipart/form-data" name="form1">
<p>
<input name="source_folder" type="file" size="50" onChange="txt_fileName.value=source_folder.value" />
<input name="txt_fileName" type="hidden" id="txt_fileName" />
</p>
<p>
<input type="submit" name="Submit" value="Test Folder" />
</p>
</form>
</body>
</html>
On remote server the dir shows as a "." (period)
Thanks