Anyone have a must come from script?

4 replies
I looked Google, wasn't happy so I thought I'd check with you folks.

Php or htaccess would be preferable to Java script. I want to use a folder with no index on the website so I don't have to list downloads. Thus I need to do a must come from for a subdirectory.

Rick
#script
  • Profile picture of the author kilgore
    I honestly have no idea what you're looking for. Something like this will list all the files in a directory:


    PHP Code:
    if ( = opendir('.')) {
        while (
    false !== ( = readdir())) {
            if ( != 
    "." &&  != "..") {
                echo 
    "n";
            }
        }
        
    closedir();

    If you want to check where the user is clicking from you could run a check on $_SERVER['HTTP_REFERER'] (in PHP) or you could use mod_rewrite in your apache config or htaccess (again checking for "RewriteCond %{HTTP_REFERER}", though this is very, VERY easily spoofed. Other options include forcing a user to login, setting cookies, etc. You could also just do something like Options +Indexes in apache. But again, all depends on what you're looking for...
    {{ DiscussionBoard.errors[10323684].message }}
  • Profile picture of the author 2WDHost
    Hi Rick.

    What forum script do you use?
    {{ DiscussionBoard.errors[10349494].message }}

Trending Topics