Skip to content

Instantly share code, notes, and snippets.

@tlhunter
Created September 18, 2012 01:05
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlhunter/3740676 to your computer and use it in GitHub Desktop.
Save tlhunter/3740676 to your computer and use it in GitHub Desktop.
PHP localhost dashboard
<?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) : "&nbsp;";
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) : "&nbsp;";
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) : "&nbsp;";
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) : "&nbsp;";
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>
@web-apply
Copy link

web-apply commented Mar 6, 2023

I liek to spam yu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment