Created
September 18, 2012 01:05
-
-
Save tlhunter/3740676 to your computer and use it in GitHub Desktop.
PHP localhost dashboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
?> | |
<html> | |
<head> | |
<title><?php echo $_SERVER['SERVER_NAME']; ?></title> | |
<style> | |
body { | |
background-color: #000; | |
margin: 10px; padding: 0px; | |
} | |
.even td { | |
background-color: #000; | |
} | |
.odd td { | |
background-color: #111; | |
} | |
.listing td { | |
border-bottom: 1px solid #333; | |
} | |
.key { | |
font-family: consolas; | |
font-size: 12px; | |
font-weight: bold; | |
text-align: right; | |
border-right: 1px solid #333; | |
border-left: 1px solid #333; | |
padding: 2px 4px; | |
color: #0f0; | |
vertical-align: top; | |
} | |
.value { | |
font-family: calibri; | |
font-size: 12px; | |
border-right: 1px solid #333; | |
padding: 2px 4px; | |
color: #fff; | |
} | |
.dir { | |
border-right: 1px solid #333; | |
border-left: 1px solid #333; | |
} | |
table.listing { | |
border-top: 1px solid #333; | |
margin: 0px; padding: 0px; | |
} | |
h1 { | |
font-family: "Trebuchet MS"; | |
font-size: 20px; | |
font-weight: normal; | |
color: #fff; | |
margin: 0 0 10px 0; padding: 0px; | |
} | |
h1 span { | |
color: #f60; | |
} | |
.dir a { | |
font-family: calibri; | |
font-size: 12px; | |
color: #f60; | |
text-decoration: none; | |
} | |
.dir a:hover { | |
color: #fff; | |
} | |
.dir { | |
padding: 2px 4px; | |
} | |
</style> | |
</head> | |
<body> | |
<table width="100%"> | |
<tr><td valign="top"> | |
<h1>$_SERVER Variables on <span><?php echo $_SERVER['SERVER_NAME']; ?></span></h1> | |
<table cellpadding="0" cellspacing="0" class="listing"> | |
<?php | |
$i = 0; | |
foreach($_SERVER as $key => $value) { | |
$tr = $i++ % 2 ? 'even' : 'odd'; | |
$value = !empty($value) ? htmlentities($value) : " "; | |
echo "<tr class='$tr'><td class='key'>$key</td><td class='value'>$value</td></tr>\n"; | |
} | |
?> | |
</table> | |
<h1>$_ENV Variables on <span><?php echo $_SERVER['SERVER_NAME']; ?></span></h1> | |
<table cellpadding="0" cellspacing="0" class="listing"> | |
<?php | |
$i = 0; | |
foreach($_ENV as $key => $value) { | |
$tr = $i++ % 2 ? 'even' : 'odd'; | |
$value = !empty($value) ? htmlentities($value) : " "; | |
echo "<tr class='$tr'><td class='key'>$key</td><td class='value'>$value</td></tr>\n"; | |
} | |
?> | |
</table> | |
<h1>$_SESSION Variables on <span><?php echo $_SERVER['SERVER_NAME']; ?></span></h1> | |
<table cellpadding="0" cellspacing="0" class="listing"> | |
<?php | |
$i = 0; | |
foreach($_SESSION as $key => $value) { | |
$tr = $i++ % 2 ? 'even' : 'odd'; | |
$value = !empty($value) ? htmlentities($value) : " "; | |
echo "<tr class='$tr'><td class='key'>$key</td><td class='value'>$value</td></tr>\n"; | |
} | |
?> | |
</table> | |
<h1>$_COOKIE Variables on <span><?php echo $_SERVER['SERVER_NAME']; ?></span></h1> | |
<table cellpadding="0" cellspacing="0" class="listing"> | |
<?php | |
$i = 0; | |
foreach($_COOKIE as $key => $value) { | |
$tr = $i++ % 2 ? 'even' : 'odd'; | |
$value = !empty($value) ? htmlentities($value) : " "; | |
echo "<tr class='$tr'><td class='key'>$key</td><td class='value'>$value</td></tr>\n"; | |
} | |
?> | |
</table> | |
</td><td width="250" valign="top"> | |
<h1>Directories</h1> | |
<table cellpadding="0" cellspacing="0" class="listing" width="100%"> | |
<?php | |
$i = 0; | |
$directory = "./"; | |
$d = dir($directory); | |
while (false !== ($entry = $d->read())) { | |
if (is_dir($directory . $entry) && $entry[0] != '.') { | |
$tr = $i++ % 2 ? 'even' : 'odd'; | |
echo "<tr class='$tr'><td class='dir'><a href='$directory$entry'>$entry</a></td></tr>\n"; | |
} | |
} | |
$d->close(); | |
?> | |
</table> | |
</td></tr> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I liek to spam yu