Location: PHPKode > scripts > Bioloide > botlane/modified.php
<?php

	session_start(); 
	include_once("authorize.php");	
	$ulogin= $_SESSION["login"];
	$upass= $_SESSION["password"];
	$registered = false;
	if(file_exists($users))
	{
		$registered= authorize($ulogin, $upass);
		if($registered == false) 
      die("You must register to use this program. Run <a href=\"index.php\">index.php</a>");
	}  

    $go_back = 0;                        
    $i = 0;                              
    $dir_count = 0;                      
    $date = time();                      
    $one_day = 86400;
    $days = preg_replace("/[^0-9]/i",'', $_POST["days"]); 
    $path = preg_replace("/[^_A-Za-z0-9-\.%\/]/i",'', $_POST["path"]);   
    $path = preg_replace("/\.\.\//",'', $path);   
    //define('ABSPATH', dirname(__FILE__));
    define('ABSPATH', $_SERVER['DOCUMENT_ROOT']);
    $path = ABSPATH.$path;   
    $directories_to_read[$dir_count] = $path;
    $rootlen = strlen(ABSPATH);
    
    
    print "<html><head><link type=\"text/css\" href=\"script.css\" rel=\"stylesheet\"></head><body><div id=\"content\"><h2>Last Modified Scripts On Your Site</h2>";
    print "<table><tr><td>";
    print "<form method=\"post\">";
    print "<tr><td>Period (last days) : </td>";
    print "<td><input type=\"text\" name=\"days\" maxlength=\"4\" size=\"4\"> days</td></tr>";
    print "<tr><td>The starting directory: </td>";
    print "<td>".ABSPATH." <input type=\"text\" name=\"path\" maxlength=\"80\" size=\"30\" value=\"/\" > (add / at end)</td></tr>";
    print "<tr><td><input type=\"submit\" value=\"Check files\"><td></td>";
    print "</form>";
    print "</td></tr></table>";
    
    $go_back = $one_day * $days;
    print "<br /> Last <strong>" . ($go_back/$one_day) ."</strong> days: <br /><br />";

    if ( $go_back > 0 )
   {
        print "<table><tr><td><b><u>Filename</u></b></td><td><b><u>Last modified date</u></b></td></tr>";
        $diff = $date - $go_back;
        
        while ( $i <= $dir_count )
        {
            $current_directory = $directories_to_read[$i];
            $read_path = opendir( $directories_to_read[$i] );
            while ( $file_name = readdir( $read_path))
            {
                if (( $file_name != '.' )&&( $file_name != '..' ))
                {
                    if ( is_dir( $current_directory . "/"  . $file_name ) == "dir" )
                    {
                        $d_file_name = "$current_directory" . "$file_name";
                        $dir_count++;
                        $directories_to_read[$dir_count] = $d_file_name . "/";
                    }
                    else
                    {
                        $file_name = "$current_directory" . "$file_name";                                
                        if ( (filemtime( $file_name)) > $diff  )
                        {
                            $relname = substr($file_name, $rootlen);
                            print "<tr><td>$relname</td>";
                            $date_changed = filemtime( $file_name );
                            $pretty_date = date("M d, Y  -  H:i:s", $date_changed);
                            print  "<td> $pretty_date</td></tr>" ;
                        }
                    }
                }
            }
            closedir ( $read_path );
            $i++;    
        }
            print "</table>";    
            print "</div></body></html>";    
    }       
?> 
Return current item: Bioloide