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
<script> | |
function isEmail(strEmail) | |
{ | |
if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) | |
return false; | |
else | |
return true; | |
} | |
function isMobel(value) | |
{ |
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
我发誓要做一个好用的在线编辑器,真的,我不骗你!!! |
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
[ISAPI_Rewrite] / RewriteEngine on | |
RewriteRule ^/(login|register|user)$ /index.php?do=$1 [L] | |
#register | |
RewriteRule ^/register/(.*?)$ /index.php?do=register&key=$1 [L] | |
RewriteRule ^/register-validate/(.*?)$ /index.php?do=register&act=validate&key=$1 [L] | |
#for Nginx | |
rewrite ^/(login|register|user)$ /index.php?do=$1 last; | |
rewrite ^/register/(.*?)$ /index.php?do=register&key=$1 last; |
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')); | |
} |
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 | |
/* 生成随机字母与数字混合验证码 */ | |
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
/* 保存填写内容 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 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
<?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 | |
//php 不同系统的换行 | |
//不同系统之间换行的实现是不一样的 | |
//linux 与unix中用 /n | |
//MAC 用 /r | |
//window 为了体现与linux不同 则是 /r/n | |
//所以在不同平台上 实现方法就不一样 | |
//php 有三种方法来解决 | |
//1、使用str_replace 来替换换行 |
NewerOlder