易截截图软件、单文件、免安装、纯绿色、仅160KB

php 防注入攻击函数

/*php 防注入函数
string  $feifa  限制元素组成
如有非法字符跳转到上一页 返回 0  没有返回 1
*/
//使用方法
//$feifa=array("select","delete","from","update","create","destory","drop","alter","and","or","like","exec","count","*","chr","mid","master","truncate","char","declare",";","-","+");
//$arrpostget=array("http://www.baidu.select cretecomdmin","wangw");
//echo saftsql($feifa,$arrpostget);
function saftsql($feifa,$arrpostget){
//
$arrpostget=array_merge((array)$HTTP_PSOT_VARS,(array)$HTTP_GET_VARS);
  if($arrpostget){
         foreach($arrpostget as $key=>$value){
              for($i=0;$i<count($feifa);$i++){
                //找非法字符在$value中的位置
                $flag=strpos($value,$feifa[$i]);              
                if($flag)
                {                    
                 echo "<script
type=\"text/javascript\">alert('URL有非法字符');</script>";
               


相关文档:

linux下apache+php安装常见问题


configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2
libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11.tar.gz
cd gd-2.0.11
sudo . ......

php中使用com组件出现"拒绝访问"的处理


代码如下,
// 建立一个指向新COM组件的索引
$word = new COM("word.application") or die("Can't start Word!");
// 显示目前正在使用的Word的版本号
echo "Loading Word, v. {$word->Version}
";
exit;
?>
有时候你会得到一个错误,
PHP Fatal error: Uncaught except ......

LAMP(Linux+Apache+Mysql+PHP)部署日志

本文记录一下本人安装LAMP的全过程
本人使用的Linux为RedHat Enterprise 5 X64
第一步:安装Mysql
Mysql的安装比较简单,为了避免出现文件找不到的情况,我依次下载安装了以下4个RPM包
MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm 
MySQL-devel-commu ......

PHP中多维数组的排序

1.用户定义排序:usort($array, functionName);其中functionName为用户定义的函数名,用户定义的函数指定排序规则,比较数组中两个元素的大小,大于返回正数,小于返回负数,等于返回0。2.反向用户排序:用户定义函数时,比较数组中两个元素的大小,大于返回负数,小于返回正数,等于返回0。$fruits = array(array('APP', ' ......

PHP分页代码

头部调用
 <?
require('conn.php');
$sql1="select id from news";
$query1=mysql_query($sql1,$conn);
$sun_num=mysql_num_rows($query1);
$gs=20;
$page_num=ceil($sun_num/$gs);
include("../subpage.php");
//传过来的页数参数
$PB_page=$_GET['PB_page'];
if ($PB_page==1 or empty($PB_page)){
$ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号