随笔分类 -  PHP

【转】如何禁用或启用fsockopen()函数
摘要:http://www.purplesecond.com/blog/2012/04/%E5%A6%82%E4%BD%95%E7%A6%81%E7%94%A8%E6%88%96%E5%90%AF%E7%94%A8fsockopen%E5%87%BD%E6%95%B0/ 阅读全文

posted @ 2012-04-06 10:06 JulianHere 阅读(224) 评论(0) 推荐(0)

【转】PHP动态随机生成验证码类
摘要:下面是类代码<?php/************************************************************************//FILE:ImageCode//DONE:生成动态验证码类//DATE"2010-3-31//Author:www.5dkx.com 5D开心博客************************************************************************/class ImageCode{private width; //验证码图片宽度private height; //验证 阅读全文

posted @ 2012-03-20 09:58 JulianHere 阅读(187) 评论(0) 推荐(0)

【转】linux服务器的Gzip文件压缩方法
摘要:转自 http://www.dabaoku.com/jiaocheng/fabu/linux/201008016596.shtmlGzip是一种流行的文件压缩算法,现在的应用十分广泛,尤其是在Linux平台。当应用Gzip压缩到一个纯文本文件时,效果是非常明显的,大约可以减少70%以上的文件大小。这取决于文件中的内容。利用Apache中的Gzip模块,我们可以使用Gzip压缩算法来对Apache服务器发布的网页内容进行压缩后再传输到客户端浏览器。这样经过压缩后实际上降低了网络传输的字节数,最明显的好处就是可以加快网页加载的速度。网页加载速度加快的好处不言而喻,除了节省流量,改善用户的浏览体验外 阅读全文

posted @ 2012-02-18 21:48 JulianHere 阅读(355) 评论(0) 推荐(0)

【转】Stupid htaccess Tricks
摘要:reposted from perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/Stupid htaccess TricksPosted on January 10, 2006 in Websites by Jeff StarrWelcome to Perishable Press! This article, Stupid htaccess Tricks, covers just about every htaccess “trick” in the book, and is easily the site’s most p 阅读全文

posted @ 2012-01-24 10:57 JulianHere 阅读(451) 评论(0) 推荐(0)

【转】URL Rewriting for Beginners
摘要:reposted from http://www.addedbytes.com/for-beginners/url-rewriting-for-beginners/A beginner's guide to URL rewriting, with plenty of examples.This article is part of the For Beginners series.IntroductionURL rewriting can be one of the best and quickest ways to improve the usability and search f 阅读全文

posted @ 2012-01-20 18:12 JulianHere 阅读(233) 评论(0) 推荐(0)

简单技巧之Apache下利用.htacess防盗链小结
摘要:在Apache服务器的前提下利用.htacess文件来防盗链的原理是通过检查图片或文件请求头信息中的Referer属性(也就是请求的来源),判断它是否属于你所规定的合法的请求来源,从而实现让合法来源能够获得请求的图片或文件、不合法的请求被转向到另一个指定的链接(通常是盗链提示的图片,并且尽量控制该文件大小从而降低流量损耗)。 具体的做法是在.htacess文件中添加类似以下几行的代RewriteEngine onRewriteCond %{HTTP_REFERER} !^$ [NC]RewriteCond %{HTTP_REFERER} !purplesecond.com [NC]Rew... 阅读全文

posted @ 2012-01-19 22:13 JulianHere 阅读(359) 评论(0) 推荐(0)

PHP流程控制替代语法举例
摘要:If:<?php if ($a == 1): ?> <div> ... </div><?php elseif ($a == 2): ?> <div> ... </div><?php else: ?> <div> ... </div><?php endif; ?>While:<?php while (expr): ?> <div> ... </div><?php endwhile; ?> 阅读全文

posted @ 2012-01-03 17:51 JulianHere 阅读(130) 评论(0) 推荐(0)

【转】PHP Last insert id
摘要:用PHP调用mysql , 内置的LAST_INSERT_ID() 这个函数可能没有什么人用,用的最多的还是 mysql_insert_id()其实,这两个是有区别的,LAST_INSERT_ID() 能返回 bigint 值的id。而,mysql_insert_id 返回的是 int 。如果你 的id 是 unsigned int,或者 bigint 的 。那么,可能是返回的是错误的。而要用 LAST_INSERT_ID() 代替还有些朋友,返回的都是 0,不知道怎么回事,其实 LAST_INSERT_ID() 返回的是 AUTO_INCREMENT 的 ID。 如果,表结构中,没有设置,A 阅读全文

posted @ 2011-12-31 00:21 JulianHere 阅读(777) 评论(0) 推荐(0)