Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="Index.php" method="get">
- Search: <input type="text" name="SearchFor" />
- <input type="submit" value="Go!" />
- </form>
- <script language="JavaScript">
- function SectionButton(s)
- {
- var Ptr = document.getElementById("obj"+s);
- if(Ptr.style.display=="none")
- {
- Ptr.style.display="inline";
- return;
- }
- if(Ptr.style.display=="inline")
- {
- Ptr.style.display="none";
- return;
- }
- }
- </script>
- <?php
- //gets a filenames extension
- function filename_extension($filename) {//{{{
- $pos = strrpos($filename, '.');
- if($pos===false) {
- return false;
- } else {
- return substr($filename, $pos+1);
- }
- }//}}}
- // Config
- // Global variables
- $Section = 1;
- $FileList="";
- function listdirectory($me,$base)
- {
- $path = $me;
- $from = "";
- if($path!=".")
- {
- $from="$me\\";
- }
- $dir_handle = @opendir($path) or die("Unable to open $path");
- echo "<ul style='border: 8px blue solid;'>";
- while ($file = readdir($dir_handle))
- {
- $Section++;
- $DisplayMe=false;
- $Extension=strtolower(filename_extension($file));
- if($file=="." || $file=="..")
- $DisplayMe=false;
- if($Extension=="")
- {
- if($file != "." && $file != "..")
- {
- echo "<li style='border: 8px lime solid;'>";
- echo '<input type="Button" value=" " onClick="SectionButton(';
- $ThisSection=$Section+rand(100,16384);
- echo $ThisSection;
- echo ');">';
- echo "$file</li>";
- if($base == 1)
- {
- echo '<span style="display: none;" ';
- echo 'id=obj';
- echo $ThisSection;
- echo '>';
- }
- echo "<li>";
- listdirectory("$from$file",0);
- echo "</li>";
- if($base == 1)
- {
- echo '</span>';
- }
- }
- }
- if($Extension=="jpg" || $Extension=="gif" || $Extension=="png" || $Extension=="svg")
- {
- $DisplayMe=true;
- }
- if($Extension=="swf")
- {
- $flashes=$flashes."<a href='$from$file'>$file (Flash)</a><br>";
- }
- if($DisplayMe==true)
- {
- $FileList=$FileList.'<a href="Presenter.php?File='.$from.$file.'">';
- $FileList=$FileList."$file</a><br>";
- }
- }
- echo "$FileList";
- echo "</ul>";
- closedir($dir_handle);
- }
- listdirectory(".",1);
- echo "<br>";
- echo $flashes;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement