I have a issue in displaying files in the folder using PHP, The code that used to display is
<?php
$dir="public_html/Uploads"; // Directory where files are stored
if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) != false)
{
?>
<p><a href="<?php echo $filename; ?>"><?php echo $filename;
?></a></p>
<?php
}
closedir($dir_list);
}
?>
this code is work fine in the local server where it is a wamp server and it list all the files in the folder.
But my problem is where it gives issue when i upload it to the hostgator server, it give me a 500 error.
Remove
public_html/from this line of code$dir="public_html/Uploads";and let me know if it works or not.