PHP 调试用 包含文件 时间:
谢氏工作室 · shelly · 2004-03-27
PHP 调试用 包含文件
时间: 2004-03-27
<?php
/**
* **]Function Name[= snk_debug()
* **]Purpose[=
* 在网页中添加一浮动层,探测预定义变量的当前值。
* **]Parameter[=
* int $bug_lv 探测变量级别,值为下列变量中要探测变量对应值之和
* 1 $_GET
* 2 $_POST
* 4 $_SESSION
* 8 $_SERVER
* 16 $_COOKIE
* 32 $_FILES
* 64 $_ENV
* **]Return[= void
* **]Author[= SNakeVil<51JS,BU>(snakevil**qq.com)
* **]Version[= 1.0.0.0
* **]Create[= 5:39 2004-3-27
* **]Modifications[=
* **]See[=
*/
function
snk_debug
(
$bug_lv
=
14
) {
if (!
is_int
(
$bug_lv
))
$bug_lv
=
intval
(
$bug_lv
);
$bug_lv
=
sprintf
(
"%07s"
,
base_convert
(
$bug_lv
,
10
,
2
));
?>
<!-- "PHP Debug Frame" Plugin Content : START -->
<style type="text/css">
TABLE#oDebugFrame {
position:absolute;
z-index:19840806;
left:expression(body.scrollLeft+100);
top:expression(body.scrollTop+100);
width:expression(Math.round(body.clientWidth/2));
height:expression(Math.round(body.clientHeight/2));
background:#99D64B;
border:solid 1px black;
overflow:visible;
cursor:default;
filter:alpha(Opacity="80");
}
TH.oDebugFrame_Button {
font:normal normal normal 9pt "Webdings";
}
DIV#oDebugFrame_Zone {
width:100%;
height:100%;
overflow-x:visible;
overflow-y:auto;
padding:0 10px;
scrollbar-3dlight-color:#99D64B;
scrollbar-highlight-color:#99D64B;
scrollbar-face-color:#222222;
scrollbar-arrow-color:#222222;
scrollbar-shadow-color:#99D64B;
scrollbar-darkshadow-color:#99D64B;
scrollbar-track-color:#99D64B;
}
P.oDebugFrame_SubCapital {
width:100%;
padding:0;
margin:10px 0 0px 0;
border-bottom:solid 1px #111111;
font:normal normal bolder 10pt "Tahoma";
color:black;
text-indent:5pt;
}
P.oDebugFrame_SubCapital_Sub {
width:100%;
padding:0;
margin:0 0 5px 0;
font:normal normal normal 7pt "Verdana";
color:#222222;
text-align:right;
}
TABLE.oDebugFrame_List {
border-collapse:collapse;
width:95%;
background:#CDE84C;
font:normal normal normal 8pt/1.2 "Verdana";
color:#111111;
table-layout:fixed;
margin-bottom:20px;
}
TABLE.oDebugFrame_List TH {
background:#E8C54C;
font:"Arial";
color:black;
letter-spacing:1px;
padding:5px;
}
TABLE.oDebugFrame_List TD {
word-break:break-all;
word-wrap:break-word;
padding:3px;
}
TD.oDebugFrame_List_Key {
font:normal normal bold 8pt "Tahoma";
}
</style>
<script language="JScript">
function HoverIt(which) {
return which.style.backgroundColor = "#DEF95D";
}
function LeaveIt(which) {
return which.style.backgroundColor = "";
}
</script>
<table id="oDebugFrame" cellspacing="0" cellpadding="0" onselectstart="return false" ondragstart="return false">
<tr style="BACKGROUND:black;COLOR:white;HEIGHT:20px">
<td style="FONT:normal normal 600 8pt 'Tahoma';TEXT-INDENT:10pt;WORD-SPACING:1px">PHP Debug Frame ( by SNakeVil )</td>
<th class="oDebugFrame_Button" onclick="oDebugFrame.filters.alpha.opacity=Math.max(10,oDebugFrame.filters.alpha.opacity-10)" title="- : 更透明…">3</th>
<th class="oDebugFrame_Button" onclick="oDebugFrame.filters.alpha.opacity=Math.min(100,oDebugFrame.filters.alpha.opacity+10)" title="+ : 更清晰…">4</th>
<th class="oDebugFrame_Button" onclick="oDebugFrame.style.display='none'" title="x : 关闭本调试窗口">**</th>
</tr>
<tr><td colspan="4"><div id="oDebugFrame_Zone">
<?php
if (
$bug_lv
[
6
]==
"1"
) {
// 0000001 $_GET 1
?>
<!-- Display $_GET -->
<p class="oDebugFrame_SubCapital">Request - Get</p>
<p class="oDebugFrame_SubCapital_Sub">a list of get variables in request</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_GET
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_GET
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
}
if (
$bug_lv
[
5
]==
"1"
) {
// 0000010 $_POST 2
?>
<!-- Display $_POST -->
<p class="oDebugFrame_SubCapital">Request - Post</p>
<p class="oDebugFrame_SubCapital_Sub">a list of post variables in request</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_POST
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_POST
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
}
if (
$bug_lv
[
4
]==
"1"
) {
// 0000100 $_SESSION 4
?>
<!-- Display $_SESSION -->
<p class="oDebugFrame_SubCapital">Request - Session</p>
<p class="oDebugFrame_SubCapital_Sub">a list of session variables in request</p>
<?php
if (isset(
$_SESSION
)) {
?>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_SESSION
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_SESSION
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
} else print(
"\t\t\t<div style=\"FONT:normal normal bold 8pt 'Verdana';COLOR:#990000;TEXT-INDENT:20pt;MARGIN-BOTTOM:15px\">\"Session\" has been not started !</div>\n"
);
?>
<?php
}
if (
$bug_lv
[
3
]==
"1"
) {
// 0001000 $_SERVER 8
?>
<!-- Display $_SERVER -->
<p class="oDebugFrame_SubCapital">PHP Web-Server</p>
<p class="oDebugFrame_SubCapital_Sub">a list of PHP web-server variables</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_SERVER
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_SERVER
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
}
if (
$bug_lv
[
2
]==
"1"
) {
// 0010000 $_COOKIE 16
?>
<!-- Display $_COOKIE -->
<p class="oDebugFrame_SubCapital">Request - Cookie</p>
<p class="oDebugFrame_SubCapital_Sub">a list of cookie variables in request</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_COOKIE
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_COOKIE
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
}
if (
$bug_lv
[
1
]==
"1"
) {
// 0100000 $_FILES 32
?>
<!-- Display $_FILES -->
<p class="oDebugFrame_SubCapital">Request - Files</p>
<p class="oDebugFrame_SubCapital_Sub">a list of upload files variables in request</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
foreach (
$_FILES
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_FILES
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
?>
</table>
<?php
}
if (
$bug_lv
[
0
]==
"1"
) {
// 1000000 $_ENV 64
?>
<!-- Display $_ENV -->
<p class="oDebugFrame_SubCapital">Environment</p>
<p class="oDebugFrame_SubCapital_Sub">a list of environment variables</p>
<table class="oDebugFrame_List" align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#111111">
<tr><th width="39%">Variable</th><th>Value</th></tr>
<?php
if (
count
(
$_ENV
)) {
foreach (
$_ENV
as
$i
=>
$j
) print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_ENV
[
'$i'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>$i</td><td>$j</td></tr>
\n
"
);
} else {
exec
(
"set"
,
$i
);
for (
$j
=
0
,
$k
=
count
(
$i
);
$j
<
$k
;
$j
++) {
$l
=
$i
[
$j
];
$m
=
strpos
(
$l
,
"="
);
$l
= array(
substr
(
$l
,
0
,
$m
),
substr
(
$l
,
$m
+
1
));
print(
"
\t\t\t\t
<tr onmouseover=
\"
HoverIt(this)
\"
onmouseout=
\"
LeaveIt(this)
\"
title=
\"\$
_ENV
[
'
{
$l
[
0
]}
'
]\"
><td class=
\"
oDebugFrame_List_Key
\"
>
{
$l
[
0
]}
</td><td>
{
$l
[
1
]}
</td></tr>
\n
"
);
}
}
?>
</table>
<?php
}
unset(
$i
,
$j
,
$k
,
$l
,
$m
);
?>
</div></td></tr>
</table>
<!-- "PHP Debug Frame" Plugin Content : END -->
<?php
return
true
;
}
if (
$_SERVER
[
"SCRIPT_FILENAME"
]==
str_replace
(
"\","
/
",__FILE__))
{
// 如果直接请求此页面
phpinfo(16+32);
}
?>
效果:
shelly
引用(Trackback0)
评论
发表评论
用户名:
Email:
主页:
最后更新
ADO 连接字串一网打尽
Advanced SQL Injection with MySQL
数据库的跨平台设计
部分ADSL猫的默认密码
如何修改论坛头象为外部URL
XMLHTTP对象及其方法
漏电、机械故障报警系统装置(广告)
成功分析 浙江移动发送短消息 验证码加密。
具有FTP运行权限,利用一例。
通用表单验证函数(JS)
=================
.::水盟论坛::.
.::三 人 行::.
=================
.::胡言乱语::.
=================
.::蓝雨空间::.
.::好 人::.
.::安安心情::.
.::小戴网络::.
.::世纪网络::.
.::花开涂鸦::.
.::凡凡纪事::.
.::喜悦国际村::.
.::TROYOO超越::.
=================
.::郭爽的BLOG::.
Microsoft Access Developers' Blog
=================
.::网站开发日志::.
=================
.::艺 壶 网::.
=================
原始快照:web.archive.org