This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($("#neglect").is(':checked')){ | |
if(confirm("确定忽略此漏洞吗?")){ | |
return true; | |
}else{ | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = '哈哈,开头我是被过滤的垃圾内容结束我才是要显示的内容一,开头我是被过滤的垃圾内容结束我才是要显示的内容二'; | |
echo $str = preg_replace("/开头.*?结束/", '', $str); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$comment=get_var("comment","POST"); | |
if(!empty($comment)){ | |
/* 回复过滤 @zm 2014-1-12 Begin */ | |
$commentFilter['0']='神马'; | |
$commentFilter['1']='浮云'; | |
$commentFilter['2']='QQ'; | |
$commentFilter['3']='qq'; | |
$commentFilter['4']='扣扣'; | |
$commentFilter['5']='秋秋'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//php 不同系统的换行 | |
//不同系统之间换行的实现是不一样的 | |
//linux 与unix中用 /n | |
//MAC 用 /r | |
//window 为了体现与linux不同 则是 /r/n | |
//所以在不同平台上 实现方法就不一样 | |
//php 有三种方法来解决 | |
//1、使用str_replace 来替换换行 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
$con=mysql_connect('localhost','root','')or die('数据库连接失败'); | |
$db=mysql_select_db('test',$con); | |
$sql="SELECT name FROM user"; | |
$query=mysql_query($sql,$con); | |
while ($row=mysql_fetch_assoc($query)) { | |
$list[]=$row; | |
} | |
foreach ($list as $k => $v) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function request($url,$data='',$headers=array()) { | |
if(empty($headers['UserAgent'])) $headers['UserAgent']='Mozilla/5.0'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 1); | |
curl_setopt($ch, CURLINFO_HEADER_OUT, 1); | |
if($data){ | |
curl_setopt($ch, CURLOPT_POST, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 保存填写内容 begin */ | |
<script type="text/javascript"> | |
function saveMyContent(){ | |
if(window.localStorage){ | |
var items=["bugtitle","description","editor_content","editor_content1","editor_content2","usertags"]; | |
$.each(items,function(k,v){ | |
var inputValue=$("#"+v).val(); | |
if (inputValue==null ||inputValue==""){ | |
inputValue=""; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 生成随机字母与数字混合验证码 */ | |
function randomkeys($length) { | |
$returnStr=''; | |
$pattern='23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'; | |
for($i=0;$i<$length;$i ++) { | |
$returnStr.=$pattern{mt_rand(0,strlen($pattern)-1)}; //生成php随机数 | |
} | |
return $returnStr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteRule ^discover$ index.php?do=discover | |
RewriteRule ^content/([a-zA-Z0-9_-]+)$ index.php?do=content&workid=$1 | |
RewriteRule ^discover/([a-zA-Z0-9_-]+)$ index.php?do=discover&id=$1 | |
RewriteRule ^content/([a-zA-Z0-9_-]+)/id/([a-zA-Z0-9_-]+)$ index.php?do=content&workid=$1&contentId=$2 | |
RewriteRule ^home/([a-zA-Z0-9_-]+)$ index.php?do=home&id=$1 | |
RewriteRule ^works/([a-zA-Z0-9_-]+)$ index.php?do=home&act=works&id=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$domain ='http://www.xxxx.com'; | |
$url = '/newskin/images/v4/logo.jpg'; | |
$pats = pathinfo($url); | |
$dir = '.'.$pats['dirname'].'/'; | |
if(!is_dir($dir)) | |
{ | |
@mkdirs($dir, 0777); | |
@fclose(fopen($dir.'/index.htm', 'w')); | |
} |
OlderNewer