摘要: 需求:现在常用的表单验证码大部分都是要用户输入为主,但这样对手机用户会不方便。如果手机用户访问,可以不用输入,而是click某一位置便可确认验证码,这样就会方便很多。原理:1.使用PHPimagecreate创建PNG图象,在图中画N个圆弧,其中一个是完整的圆(验证用),将圆心坐标及半径记录入session。2.在浏览器,当用户在验证码图片上点击时,记录点击的位置。3.将用户点击的坐标与session记录的圆心坐标、半径比较,判断是否在圆中,如是则验证通过。ClickCaptcha.class.phpsess_name = $sess_name; // 设置session name } ... 阅读全文
posted @ 2013-05-04 16:18 傲雪星枫 阅读(401) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash# 更新css文件内图片的版本# 如background:url('images/test.jpg'); 更新为 background:url('images/test.jpg?20130330121210');csstmpl_path="/home/fdipzone/php/csstmpl" # css tmpl pathcss_path="/home/fdipzone/php/css" # css pathreplacetags=(".png" ".jpg" 阅读全文
posted @ 2013-05-01 11:12 傲雪星枫 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1.开启rewritesudo a2enmod rewrite2.停用rewritesudo a2dismod rewrite3.服务器环境变量Apache提供给rewirte模块的环境变量大概分成5个类型.第一部分: HTTP headers 部分参数参数名称: HTTP_USER_AGENT样例参考值: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8说明: 相当于PHP中的服务器参数: $_SERVER["HTTP_USER_AGENT" 阅读全文
posted @ 2013-04-30 17:21 傲雪星枫 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 流程1.登入google play登入google play需要三步https://play.google.com/apps/publish/https://accounts.google.com/ServiceLogin?hl=en&continue=https://play.google.com/apps/publish/https://accounts.google.com/ServiceLoginAuth2.下载app report zip3.unzip report代码如下:username = $username; $this->password = $passwor 阅读全文
posted @ 2013-04-19 01:27 傲雪星枫 阅读(507) 评论(0) 推荐(0) 编辑
摘要: memcached 进程启动及监控1.memcached_inc.sh设置路径,端口等讯息。#!/bin/sh#config includeHOST=$(hostname)SITE="mysite"PORT=11211MEMCACHED_PID_FILE="/tmp/memcached.pid"MEMCACHED_DAEMON_PID_FILE="/tmp/memcached_daemon.pid"MEMCACHED="memcached -d -m 64 -p $PORT -u memcache -l 127.0.0.1 阅读全文
posted @ 2013-04-14 00:20 傲雪星枫 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Apache 搭建虚拟主机方法DocumentRoot: /home/fdipzone/sites/demo.fdipzone.comServerName:demo.fdipzone.com1.进入apache虚拟主机设置目录cd /etc/apache2/sites-available2.创建文件demo.fdipzone.com ServerAdmin webmaster@localhost DocumentRoot /home/fdipzone/sites/demo.fdipzone.com ServerName demo.fdipzone.co... 阅读全文
posted @ 2013-04-05 13:22 傲雪星枫 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 正向代理的概念正向代理,也就是传说中的代理,他的工作原理就像一个跳板,简单的说,我是一个用户,我访问不了某网站,但是我能访问一个代理服务器这个代理服务器呢,他能访问那个我不能访问的网站于是我先连上代理服务器,告诉他我需要那个无法访问网站的内容代理服务器去取回来,然后返回给我从网站的角度,只在代理服务器来取内容的时候有一次记录有时候并不知道是用户的请求,也隐藏了用户的资料,这取决于代理告不告诉网站结论就是 正向代理 是一个位于客户端和原始服务器(origin server)之间的服务器,为了从原始服务器取得内容,客户端向代理发送一个请求并指定目标(原始服务器),然后代理向原始服务器转交请求并将获 阅读全文
posted @ 2013-03-31 21:41 傲雪星枫 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 1.给子域名加www标记RewriteCond %{HTTP_HOST} ^([a-z.]+)?example\.com$ [NC]RewriteCond %{HTTP_HOST} !^www\. [NC]RewriteRule .? http://www.xample.com%{REQUEST_URI} [R=301,L]这个规则抓取二级域名的%1变量,如果不是以www开始,那么就加www,以前的域名以及{REQUEST_URI}会跟在其后。2.去掉域名中的www标记RewriteCond %{HTTP_HOST} !^example\.com$ [NC]RewriteRule .? ht 阅读全文
posted @ 2013-03-31 21:18 傲雪星枫 阅读(170) 评论(0) 推荐(0) 编辑
摘要: shell sh 每天备份log文件#!/bin/bash# 每天备份log文件log_path="/home/fdipzone/logs" # log目录backup_path="/home/fdipzone/logs/bak" # 备份目录expire=30 # 备份文件只保留30天function backup(){ if [ -d "$log_path" ] && [ -d "$backup_path" ]; then for file in $(find $log_path -maxdep 阅读全文
posted @ 2013-03-30 17:05 傲雪星枫 阅读(184) 评论(0) 推荐(0) 编辑
摘要: FindFile.class.php用于遍历目录文件0){ $this->maxdepth = $maxdepth; }else{ $this->maxdepth = 0; } $this->files = array(); $this->traversing($spath); // 遍历 } /* 遍历文件及文件夹 * @param String $spath 文件夹路径 * @param int $depth 当前文件夹深度 */ priv... 阅读全文
posted @ 2013-03-22 01:28 傲雪星枫 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 在服务器安装 sendmailsudo apt-get install sendmail启动 sendmailsudo /etc/init.d/sendmail start修改 php.ini[mail function]SMTP = localhostsmtp_port = 25sendmail_from = me@example.comFunction sendMailIsSMTP(); // 经smtp发送 //$mail->Host = "smtp.gmail.com"; // SMTP 服务器 //$mail->Port = 465; ... 阅读全文
posted @ 2013-03-17 16:34 傲雪星枫 阅读(232) 评论(0) 推荐(0) 编辑
摘要: memcached 查看方法格式: telnet ip port例如telnet localhost 11211退出命令:quit一.存储命令存储命令格式: 参数说明:command name命令名称key查找关键字flag存储额外信息expire数据保存时间,0表示永远,单位秒bytes存储数据的字节数data block存储的数据1.set 无论如何都存储,数据不存在时存储,数据存在时更新。set mykey 0 0 3123STOREDset mykey 0 0 3456STORED2.add 当数据不存在时存储。add mykey 0 0 3123STOREDadd mykey ... 阅读全文
posted @ 2013-03-10 13:53 傲雪星枫 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 游戏介绍:这是一个翻牌配对游戏,共十关。1.游戏随机从42张牌中抽取9张进行游戏,每组为2张相同的牌,共18张牌。2.连续翻到两张相同的为胜利,当9组全部翻到则过关。如不是翻到连续两张相同的,则需要重新翻。3.游戏共有10关,在规定时间内通过为挑战成功。4.如果某关在规定时间内没有通过,则会从当前关继续游戏。5.游戏中的卡牌图片与音乐均为大宇公司所有。6.需要支持html5的浏览器,chrome与firefox效果最好。游戏图片:源码下载地址:点击下载Javascript部分:/** 仙剑翻牌游戏* Date: 2013-02-24* Author: fdipzone* Ver... 阅读全文
posted @ 2013-03-03 12:27 傲雪星枫 阅读(288) 评论(0) 推荐(0) 编辑
摘要: php 5.3 后新增了 __call 与__callStatic 魔法方法。__call 当要调用的方法不存在或权限不足时,会自动调用__call 方法。__callStatic 当调用的静态方法不存在或权限不足时,会自动调用__callStatic方法。__call($funcname, $arguments)__callStatic($funcname, $arguments)参数说明:$funcname String 调用的方法名称。$arguments Array 调用方法时所带的参数。__call 例子memberdata[$name] = $arguments[0]; ... 阅读全文
posted @ 2013-02-15 00:42 傲雪星枫 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 游戏介绍:业余时间写的一个飞行射击游戏,纵向,共六关。游戏需求:1.战机可发射子弹,子弹可通过获取道具升级。2.战机可放bomb,可获取道具增加数量。3.战机可蓄力攻击。4.道具有三种,分别是升级子弹,增加bomb数量,增加战机数量。5.每关音乐不同。6.战机被击落后再进入战场,有保护状态。7.敌机AI设计。游戏图片:源文件下载地址:点击下载Javascript部分:/** 宇宙战机* Author: fdipzone* Date: 2013-02-12* Ver: 1.0*/window.onload = function(){ var gameimg = [ ... 阅读全文
posted @ 2013-02-13 12:39 傲雪星枫 阅读(128) 评论(0) 推荐(0) 编辑
摘要: shell sh 更新 css图片版本#!/bin/bashcsstmpl_path="/home/fdipzone/php/csstmpl"css_path="/home/fdipzone/php/css"replacetags=(".png" ".jpg" ".gif")convertnum=0search_child=$1echo ${search_child:=0} > /dev/nullfunction create(){ tmplfile=$1 dfile=$2 css_con 阅读全文
posted @ 2013-02-10 15:00 傲雪星枫 阅读(156) 评论(0) 推荐(0) 编辑
摘要: CSSUpdate.class.phpis_ready = 0; }else{ $this->csstmpl_path = $csstmpl_path; $this->css_path = $css_path; $this->replacetags = $replacetags; $this->search_child = $search_child; $this->is_ready = 1; } } /** 更新css文件 */ publ... 阅读全文
posted @ 2013-02-05 02:29 傲雪星枫 阅读(119) 评论(0) 推荐(0) 编辑
摘要: XMLParser.class.phpparser($xmlstring); return $this->response($flag, $data); } /** 读取xmlstring * @param String $xmlstring * @return Array */ public function loadXmlString($xmlstring){ // parser xml list($flag, $data) = $this->parser($xmlstring); return ... 阅读全文
posted @ 2013-02-02 14:51 傲雪星枫 阅读(182) 评论(0) 推荐(0) 编辑
摘要: /** 強制更新圖片緩存* @param Array $files 要更新的圖片* @param int $version 版本*/function force_reload_file($files=array(), $version=0){ $html = ''; if(!isset($_COOKIE['force_reload_page_'.$version])){ // 判斷是否已更新過 setcookie('force_reload_page_'.$version, true, time()+2592000); $html .= ' 阅读全文
posted @ 2013-01-09 22:30 傲雪星枫 阅读(359) 评论(0) 推荐(0) 编辑
摘要: DataReturn.class.phptype = $this->exists($param,'type')? strtoupper($param['type']) : 'JSON'; // 類型 JSON,XML,CALLBACK,ARRAY $this->xmlroot = $this->exists($param,'xmlroot')? $param['xmlroot'] : 'xmlroot'; // xml root dom name $this->callbac 阅读全文
posted @ 2013-01-09 21:55 傲雪星枫 阅读(236) 评论(0) 推荐(0) 编辑