边测试边写,因为发现采集的内容中有<script>里面内容不一定知道!所以想到正则这个无所不在的东西!


SELECT id,content from cuku_news where content   REGEXP '<script type=\"text\/javascript\">.*<\/script>' order by id desc

上面找出的记录 960条!

在经过下面两组sql的测试,


SELECT id,content from cuku_news where content   like '%</script>%' order by id desc
SELECT id,content from cuku_news where content   like '%<script%' order by id desc


找出结果 960条!


说明正则是对的!

现在要替换!

以前的在 blog说过mysql 的replace功能,现在把replace和 regexp结合起来! 然后update一下

可是在mysql里面没有,
这里找mysql的兄弟来帮忙

$pattern1='/<script[^>]*?>.*?<\/script>/si';
foreach($list as $lst)
{

    $UpdateSQL = sprintf("UPDATE  ".TAB."news  SET `content`= %s where   `id`= %s ",
   GetSQLValueString(preg_replace($pattern1, '', $lst['content']) ,"text"),
   GetSQLValueString($lst['id'],"int"));
   echo $db->query($UpdateSQL);


}

这样就可以把里面的js 都给拿了!


select substr(pid,1,LOCATE(',',pid)-1) as pid from cuku_newscat


这个是对于尾部的处理!

在et下设计下,sitemap变得非常简单,模板中这样的


<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>{config['url']}</loc>
<lastmod>{nowtime}</lastmod>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>
<!--$list as $lst-->
<url>
<loc>{config['url']}{lst['act']}{lst['linkname']}{lst['id']}{lst['page']}.htm</loc>
<lastmod>{lst[datetime]}</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
<!--end-->
</urlset>


结果发现数组相加的时候,会因相同的key而消失!事得其反,在下班的时候,发现了正常了
新的sitemap点这里厦门机票
Tags:

    #products
        RewriteRule ^products/([0-9]+)\.htm$ products.php\?&page=$1
        RewriteRule ^products/([0-9]+)-([0-9]+)\.htm$ products.php\?id=$1\&page=$2
        RewriteRule ^products/([a-zA-Z+|\_|\-]+)([0-9]+)-([0-9]+)\.htm$ products.php\?linkname=$1\&id=$2\&page=$3
        RewriteRule ^products/([a-zA-Z+|\_|\-]+)-([0-9]+)\.htm$ products.php\?linkname=$1\&page=$2
        RewriteRule ^product/([a-zA-Z|\-|\_]+|)([0-9]+)\.htm$ product.php?id=$2


数字,或是字母,或是混合!
Tags:
$str= "3,4,5";
echo preg_replace("[(\d+)|(,)]", "-", $str);


虽然是少了点,但也是到学到内容!

ps
標題錯了!
第一,先判断用户是否存在,

第二,判断是否有权限,

第二,读取资料,memberid不为空的第一组

然后在load的时候 在处理是否是最高管理等级,和上一级的处理

列表的时候判断,还在在搜索的进修判断,

审核的时候,

判断两个

一个判断,写两个表,

加个pid去判断

最高权限登入,和非最高权限登入!

xss攻击大全 不指定

Else , 2010/07/12 11:28 , 程员外的那些事儿 , Comments(0) , Reads(636) , Via Original
http://ha.ckers.org/xss.html

就是上面的网址进去,里面有很多!


这里有新一代的攻击!
其中就有不包'的攻击!看下面的评论就知道了!
http://www.cnblogs.com/BenjaminYao/archive/2010/07/09/1774074.html

其他漏洞

标签<body >有个属性"onload”,它会把属性中的值直接解析为javascript脚本,而不需要"<script></script>”或"javascript:”。据说淘宝曾经因为不知道这个漏洞,而导致上万的用户受到损失。
互联网电子公告服务专项审批(备案)

《互联网信息服务管理办法》(国务院令第292号)

国务院决定取消的行政审批项目目录

虽然 是备案取消 ,但是一台机器,放一个没有备案的网站就罚5000,这笔钱希望有人去算一下!不被捞去的钱,就没有人来管,一个取消就可以走人!
1,页头要放

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>


2.不要用rs.addnew 和rs.update

要 不然你要把过虑做得很好

DateTime.ToString( "d"); // 返回 DateTime 值;“d”是标准短日期模式。
DateTime.ToString( "%d"); // 返回月中的某天;“%d”是自定义模式。
DateTime.ToString( "d "); // 返回后面跟有一个空白字符的月中的某天;“d”是自定义模式。
Tags:
出处 php文档
<?
$string = "One        Two          Three  Four";

$var = eregi_replace(" +", " ", $string);

echo $var;
?>


输出结果
Quotation
One Two Three Four
Pages: 22/178 First page Previous page 17 18 19 20 21 22 23 24 25 26 Next page Final page [ View by Articles | List ]