首页 / 代码程序

‘代码程序’ 分类文章存档

常用正则表达式

2009-10-12 00:26

正则表达式

是由普通字符(例如字符 a 到 z)以及特殊字符(称为元字符)组成的文字模式。正则表达式作为一个模板,将某个字符模式与所搜索的字符串进行匹配。
可以通过在一对分隔符之间放入表达式模式的各种组件来构造一个正则表达式,即/expression/

普通字符

由所有那些未显式指定为元字符的打印和非打印字符组成。这包括所有的大写和小写字母字符,所有数字,所有标点符号以及一些符号。 阅读全文 »

PHP 编译笔记

2009-01-03 18:08

1. theplanet WHM 编译笔记。php version 5.2.5

./configure --enable-bcmath --enable-calendar --enable-ftp
--enable-gd-native-ttf --enable-libxml --enable-magic-quotes
--enable-mbstring --enable-pdo=shared --enable-sockets
--prefix=/usr/local --with-apxs2=/usr/local/apache/bin/apxs
--with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd
--with-gettext --with-imap=/opt/php_with_imap_client/
--with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos
--with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/
--with-mcrypt=/opt/libmcrypt/ --with-mhash=/opt/mhash/
--with-mime-magic --with-mysql=/usr
--with-mysql-sock=/var/lib/mysql/mysql.sock --with-openssl=/usr
--with-openssl-dir=/usr --with-pdo-sqlite=shared
--with-png-dir=/usr --with-sqlite=shared --with-ttf
--with-xmlrpc --with-xpm-dir=/usr --with-zlib
--with-zlib-dir=/usr

2. Shanghai Server 默认编译笔记。php version: 5.1.6 阅读全文 »

php教程 - 学习php之第一天

2008-12-18 04:58

想想学习ASP已经有些日子了,但是很多项目都需要用到PHP,从今天开始,坚持学习PHP,我这里暂时是以 Apache web server 和 access作为WEB服务器和数据库,在php-5.2.5.5下的环境做的程序。

下面开始学习简单PHP的语法。 阅读全文 »

对目录进行密码保护的PHP代码

2006-02-15 00:50

下面的代码可以对你的目录进行保护:
<?
//part 1
if (!isset($PHP_AUTH_USER))
{
header("WWW-Authenticate: Basic realm=\"Spoono Password.\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
}

//part 2

else if(($PHP_AUTH_USER=="spoono") && ($PHP_AUTH_PW=="spoono"))
{
echo "You got in...";
//place the code for the whole user page in here
//you can also set up a redirect to the user page if you want
}
阅读全文 »

Wordpress访问状况统计插件 - BAStats

2005-10-21 12:29

BAStats是一个功能非常齐全的WordPress用户访问状况统计插件,安装非常简单,上传到插件目录,启用就可以了。然后在主菜单可以看到一个Stats的标签,点击即可查看统计数据。在Options里边还有设置项目。
下载:http://asymptomatic.net/bastats-pre-release/ 阅读全文 »

开发基于Google Maps API 的Web应用

2005-10-17 00:03

Frapper 是一个基于Google Maps API 开发的简单的朋友圈Web应用,用户可以在Frapper创建一个组(GMap实例),有相同兴趣的人可以在这个组(GMap实例)中标识出个人的位置(GMarker(GPoint, GIcon))……

任何人都可注册获得Google Maps API key,并使用已开放API的11个类轻松地开发出基于Google Maps的Web应用。 阅读全文 »