scandir() isn't working on hosting server, but works local
Posted: Thu Apr 09, 2009 11:22 pm
Heres the hosting url
http://ukanadian.com/genn/listing.php
the error
Fatal error: Call to undefined function: scandir() in /homepages/4/d256007782/htdocs/genn/listing.php on line 13
Heres the code for that page
The purpose of the site is really just to expand my knowledge of PHP so I plan on expanding the complexity of the code to accomplish greater tasks as I progress.
Anyway localhost is displaying the files in the current working dir but on the server its telling me the above error. Any reason as to why?
http://ukanadian.com/genn/listing.php
the error
Fatal error: Call to undefined function: scandir() in /homepages/4/d256007782/htdocs/genn/listing.php on line 13
Heres the code for that page
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Download *BETA*</title>
</head>
<body>
<?php
echo "contents of ".getcwd()."<br />";
$cur = getcwd();
$cur = scandir($cur);
foreach ($cur as $temp) {
?>
<p>
<ul>
<li>
<a href="<?php echo $temp; ?>"><?php echo $temp; ?></a></li>
</ul>
</p>
<?php
}
?>
</body>
</html>
The purpose of the site is really just to expand my knowledge of PHP so I plan on expanding the complexity of the code to accomplish greater tasks as I progress.
Anyway localhost is displaying the files in the current working dir but on the server its telling me the above error. Any reason as to why?