PHP - Files from folder on a webpage
#10

Well, where do the links take you?

pawn Код:
<?php  
if ($handle = opendir('uploads')) {  
    while (false !== ($file = readdir($handle))) {  
        if ($file != "." && $file != "..") {  
            echo "<u><a href=\"uploads/$file\">$file</a></u><br />";  
        }  
    }  
    closedir($handle);  
}  
?>
Works as intended for me.

The problem with your original code is that you're pointing to the root directory of the file that contains this code, but the files you're linking to are actually contained in the uploads subdirectory. So you need to point in there, someone else actually posted this solution earlier, but you ignored it
Reply


Messages In This Thread
PHP - Files from folder on a webpage - by Jantjuh - 21.02.2011, 15:27
Re: PHP - Files from folder on a webpage - by viKKmaN - 21.02.2011, 15:34
Re: PHP - Files from folder on a webpage - by Jantjuh - 21.02.2011, 15:42
Re: PHP - Files from folder on a webpage - by viKKmaN - 21.02.2011, 15:45
Re: PHP - Files from folder on a webpage - by Jantjuh - 21.02.2011, 15:49
Re: PHP - Files from folder on a webpage - by saiberfun - 21.02.2011, 15:54
Re: PHP - Files from folder on a webpage - by Jantjuh - 21.02.2011, 15:58
Re: PHP - Files from folder on a webpage - by saiberfun - 21.02.2011, 15:59
Re: PHP - Files from folder on a webpage - by Jantjuh - 21.02.2011, 16:13
Re: PHP - Files from folder on a webpage - by JaTochNietDan - 21.02.2011, 17:48

Forum Jump:


Users browsing this thread: 2 Guest(s)