below is the code I am using, $sourcefile is a url var
for example http://url/?sourcefile=/this/path/to/whatever.php

$filelist = array("",
            "db_auth.conf",
            "config.php",
            "master.functions.inc"
            );        /* these are the files I want to protect from this
script */

function check_hackers($sourcefile, $filelist) {
        $checkfile = explode("/", $sourcefile);        /* seperate the
sourcefile var */
        $disallowed = $checkfile[count($checkfile) -1];    /* use only
the last  part (filename.ext) */
        $filecount = count($filelist);    /* count how many files in
array */
        while ($tempcount < $filecount) {
        $tempfile = $filelist[$tempcount];
        if ($tempfile == $disallowed) {
                $sourcefile = "source.inc";        /* this is not
returned to the global space .... why not ??? */
                echo $disallowed;                    /* this will echo
the correct thing (config.php) */
                echo $tempfile;                        /* this will echo
the correct thing (config.php) */
                return $sourcefile;                /* this doesn't work
either ???? what the ??? */
        }
        $tempcount++;
        }
}

check_hackers($sourcefile, $filelist);

Can somebody tell me why this is not return $sourcefile = "source.inc"
.... what am I doing wrong.
Can you please reply to [EMAIL PROTECTED]  PLEASE PLEASE PLEASE


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to