首页

2010年10月31日星期日

PHP MYSQL JQUERY JS 编写二级联动下拉列表

由于本文带源代码的原因在此没法正常显示

请浏览www.wackguild.tk 我的博客浏览

我的百度空间也有http://hi.baidu.com/dszul

2010年7月23日星期五

PHP jquery ajax 提交登录

query ajax代码:

$(document).ready(function(){
    $("#form").submit(function(){
        login();
        return false;
    });
});
function login() {
var user = $("#username").val();
var pass = $("#password").val();
if (user == "") {
    $("#confirm").text(alert("请输入登录用户名!"));
    $("username").focus();
    return false;
}
if(pass == "") {
    $("#confirm").text(alert("请输入登录密码!"));
    $("#password").focus();
    return false;
}
$.ajax({
    type: "POST",
    url: "login_comment.php",
    data: "username=" + user + "&password=" + pass,
    beforeSend: function(){
    $("confirm").text("登录中,请稍候");
    },
    success: function(msg){
    var mss = msg.match(/.*?<\/body>/img).join("=").replace(//g,"").replace(/<\/body>/g,"").split("=");
    if(mss == "success"){
        var loginout_url ='退出';   
        $("#confirm").html("");

    }else {
        $("#confirm").text(alert("没有此用户或者密码不正确!"));
    }
    }
});
}   

html 代码:


                   
                   
                   
                    找回密码 | 注册用户
                   


PHP 代码:
session_start();

if($_POST["paaword"]&&$_POST["username"]){
    $_SESSION[id]=$_POST["username"];
    setcookie('n',$_POST["username"],time()+3600);
    setcookie('p',$_POST["password"],time()+3600);
    $_SESSION[p]=$_POST["password"];
}
$p = isset($_POST["password"]) ? $_POST["password"] : $_GET["password"];
$id = isset($_POST["username"]) ? $_POST["username"] : $_GET["username"];
if($id && $p ){
    echo 'success';
}

2010年7月21日星期三

PHP之Emacs实现自动提示

这里主要感谢“土豆”兄弟提供的一个日本emacser 的博客网站地址,在哪里看到详细的配置,我也是按照步骤配置的,结果成功了。不过还需要改进,有点别扭,

得知此配置的网站:http://d.hatena.ne.jp/IMAKADO jump

首先将这个文件download下来,放在一个路径里面。我的就放在 ~/.emacs.d/php/下面

wget http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el

将此文件加载到配置文件中去。
(add-to-list 'load-path "~/.emacs.d/php/")
(require 'install-elisp)
(setq install-elisp-repository-directory "~/.emacs.d/php/");;设置使用install-elisp-from-emacswiki 后下载下来的文件路径,我把它们放在一个文件夹里面

然后使用M-x将相关的文件get download下来,不用管它会怎么样,因为我们设置了下载路径,自动会下载到那个路径文件夹里面。(* 注意,Pagename输入后 他会自动打开,你需要执行C-c C-c 进行编译。)
M-x:
install-elisp-from-emacswiki
Pagename:
anything.el
M-x:
install-elisp-from-emacswiki
Pagename:
anything-match-plugin.el
M-x:
install-elisp-from-emacswiki
Pagename:
auto-complete.el


;;完成后在.emacs 加入此句代码 :

(locate-library "auto-complete.el")

;;然后重新载入下.emacs 文件。跟前面的操作一样,我们的PHP配置文件给弄下来编译。
M-x:
install-elisp-from-emacswiki
Pagename:
php-completion.el

;;php 自动提示设置

(add-hook 'php-mode-hook
(lambda()
(require 'php-completion)
(php-completion-mode t)
(define-key php-mode-map (kbd "C-c p") 'phpcmp-complete)
(when (require 'auto-complete nol t)
(make-variable-buffer-local 'ac-sources)
(add-to-list 'ac-sources 'ac-source-php-completion)
(auto-complete-mode t))))

2010年6月26日星期六

强悍的HTML

HTML5 的 Canvas 对象将改变 JavaScript 的使命,使之成为 HTML5 下强大的动画脚本编写工具。本文介绍了 8 个你从未见过的,基于 HTML5 Canvas 和 JavaScript 的动画,这些令人难以置信的效果将使你对 HTML5 彻底折服。需要指出的是,这些都是浏览器的原生动画,无需任何插件。
Tunnelers

纯 JavaScript + HTML5 Canvas 生成的交互动画,难以置信。
The Mesmerizer

在格子中移动鼠标,颜色随着改变并扩散到周围的格子,很迷幻。用鼠标点四角的格子,或按键盘,可以看到更奇妙的效果。
Burn


在页面上移动鼠标,或按下鼠标,这样的效果,很难相信是浏览器原生的。
Cheloniidae Live

也是基于纯粹的 JavaScript,不过使用了一个 JavaScript 库。很有趣,你可以通过修改其 JavaScript 代码实现自己的效果(可惜被墙了)。
Canvas 3D engine

一个基于 Canvas 的 3D 引擎。目前只支持预设的图形,纹理及基本交互功能。
Bomomo

很值得一试。
DDD

这个交互动画也很有趣。
Plasma Tree

非常阿凡达。
本文国际来源:queness.com 8 Simply Amazing HTML5 Canvas and Javascript Animations (原文作者 kevin
中文翻译来源:锐商企业CMS 网站内容管理系统 官方网站

2010年6月24日星期四

用php中的popen函数实现php的并发处理

用php中的popen函数实现php的并发处理:当我们需要调用一个比较耗时外部资源时使用popen这个函数, 最常见的就是从外部API获取相关内容.使用方法:
1. 建立外部资源脚本。 如示例中使用t.sh。 当然, 也可以直接使用curl等命令行2. 准备好参数, 提供给pipe脚本
2. 使用popen调用脚本。 调用之后,就不用关心了。
3. 开始其他的和pipe不相关的逻辑处理
4. 其他处理完成之后, 使用fgets等方式,
获取popen的数据
php程序:
# get argument for pipe here if it has.
#start pipe
echo ’call popen start: ’. date("H:i:s"), "\n";
$pipe = popen(dirname(__FILE__) . ’/t.sh’, ’r’);
echo ’call popen end: ’. date("H:i:s"), "\n";
#Other code here
sleep(5);
echo "Here is my code. time: " . date("H:i:s"), "\n";
#read pipe result
while ($s = fgets($pipe,1024)) {
echo $s;
}
pipe脚本:
echo 1, `date +%T`;
sleep 1;
echo 2, `date +%T`;
sleep 10;
echo 3, `date +%T`;
输出结果:
call popen start: 10:16:40
call popen end: 10:16:40
Here is my code. time: 10:16:451, 10:16:402, 10:16:413, 10:16:51
结论, 我们有三个sleep。
php中一个 sleep 5,sh中两个sleep, 10+1如果使用串行的方式, 那么用时应该是10+1+5 = 16秒。而使用pipe方式, 用时仅为:max(php, pipe) = max(5,11) = 11秒。

2010年6月22日星期二

纯 CSS3 实现的 Twitter 图画

上过 Twitter 的人都知道下面的这幅图片,这是 Twitter 的出错画面。一位叫 Steve Dennis 的新西兰 Web 前端设计师,使用纯 CSS 生成了这幅画面,甚至,假如你使用基于 Webkit 的浏览器(Safari 或 Chrome),画面还可以动,不过,对 IE 浏览器,生成的效果还差强人意。

作者的灵感来自 Twitter 的一次宕机,当 Twitter 页面上出现这个画面,他突发奇想,希望用 CSS 生成一幅同样的图画,并加上动画效果。

如何实现

事实上很不容易,纯手工编码,不断的试验与失败。曲线使用 CSS 的圆角功能,复杂线条则使用容器遮罩,花了一个周末,很有趣,但不想再尝试第二回。

在 IE 里怎么样

以下是在 IE8 里面生成的效果截图,差强人意。
IE8's whale fails.

反馈

作者的博客中,获得了百余条反馈,有人提到在 iPhone 中显示有些问题,但在 Android 中显示很完美。但无一例外都对这一 CSS 作品表现出由衷的敬意,也有人提到用 SVG 实现更容易,不过,这一工作的意义在于对 CSS 的能力进行一次残酷测试,看来 CSS 挺过来了,虽然过程有些痛苦。
本文国际来源:subcide.com Pure CSS Twitter Fail Whale (原文作者:Steve Dennis)
中文编译来源:锐商企业CMS 网站内容管理系统 官方网站
上过 Twitter 的人都知道下面的这幅图片,这是 Twitter 的出错画面。一位叫 Steve Dennis 的新西兰 Web 前端设计师,使用纯 CSS 生成了这幅画面,甚至,假如你使用基于 Webkit 的浏览器(Safari 或 Chrome),画面还可以动,不过,对 IE 浏览器,生成的效果还差强人意。

作者的灵感来自 Twitter 的一次宕机,当 Twitter 页面上出现这个画面,他突发奇想,希望用 CSS 生成一幅同样的图画,并加上动画效果。

如何实现

事实上很不容易,纯手工编码,不断的试验与失败。曲线使用 CSS 的圆角功能,复杂线条则使用容器遮罩,花了一个周末,很有趣,但不想再尝试第二回。

在 IE 里怎么样

以下是在 IE8 里面生成的效果截图,差强人意。
IE8's whale fails.

反馈

作者的博客中,获得了百余条反馈,有人提到在 iPhone 中显示有些问题,但在 Android 中显示很完美。但无一例外都对这一 CSS 作品表现出由衷的敬意,也有人提到用 SVG 实现更容易,不过,这一工作的意义在于对 CSS 的能力进行一次残酷测试,看来 CSS 挺过来了,虽然过程有些痛苦。

2010年6月21日星期一

迅雷专用链接原理及转换

对于迅雷专用链接不用我去解释相信大家都明白(别告诉我你不懂~汗),现在就链接的编码原理及转换详细说明一下,明白以后就可以用迅雷下载快车、旋风专用 地址的软件啦。

首先要明白Base64编码是怎么一回事,不懂的先去百度一下再回来。
Base64编码是一种加密算 法,Email的原始信息就是由Base64编码构成的。
而这些专用链接都是通过Base64编码加工转换而成的。

迅雷专用 地址例子:thunder://QUFodHRwOi8vZG93bi5pcHZ2LmNuL3diLmV4ZVpa
真实文件下载链 接:http://down.ipvv.cn/wb.exe

附转换工具下载:http://ifu25.cn /VC_down.asp?FileName=ChangeRUL.rar

搞懂了Base64编码之后,一切都变的得心应手了:

实 例原始地址:http://im.baidu.com/install/BaiduHi.exe

1、迅雷专用链接编码

在 原地址前面加"AA",后面加"ZZ"(不包括引号),地址变为

AAhttp://im.baidu.com/install/BaiduHi.exeZZ

此地址base64编码为

QUFodHRwOi8vaW0uYmFpZHUuY29tL2luc3RhbGwvQmFpZHVIaS5leGVaWg==

迅雷专链即在上地址前加thunder://,即

Thunder://QUFodHRwOi8vaW0uYmFpZHUuY29tL2luc3RhbGwvQmFpZHVIaS5leGVaWg==
2、快车专用链接编码

在原地址前后都加上"[FLASHGET]"(不包括引号),地址变为

[FLASHGET]http://im.baidu.com/install/BaiduHi.exe[FLASHGET]

此地址base64编码为

W0ZMQVNIR0VUXWh0dHA6Ly9pbS5iYWlkdS5jb20vaW5zdGFsbC9CYWlkdUhpLmV4ZVtGTEFTSEdFVF0=&yinbing1986

快车专链即在上地址前加flashget://,注意后面还要加上"&符号",符号怎么得出不清楚,在最后后面加的是好好爱的 个人信息,至今未有人报告转换错误,即

Flashget://W0ZMQVNIR0VUXWh0dHA6Ly9pbS5iYWlkdS5jb20vaW5zdGFsbC9CYWlkdUhpLmV4ZVtGTEFTSEdFVF0=&yinbing1986

3、旋风专用链接编码

旋风相对就简单多了,将原地址直接base64编码为

aHR0cDovL2ltLmJhaWR1LmNvbS9pbnN0YWxsL0JhaWR1SGkuZXhl

旋风专链即在上地址前加qqdl://,即

qqdl://aHR0cDovL2ltLmJhaWR1LmNvbS9pbnN0YWxsL0JhaWR1SGkuZXhl

2010年6月18日星期五

Become a Master of Typography with 25+ Great Tutorials

This time I’ve put together a variation of different typography-related tutorials for you to practice your skills. Most of these are Photoshop tutorials, and some also include a couple of other programs.
These typography-effects can show you some new tips and tricks to use in all kinds of designs, from backgrounds to web-design and more. Get ready to fill up your design toolbox with a couple of new tricks!

Milk

Here you will learn to create a font in illustrator to then mix it with some images in Photoshop. A funny and versatile effect that can be applied to many different kinds of liquid as long as you have photos to use!

Typography wallpaper

This simple yet unique and powerful look comes in handy for many different designs. Play around with settings in Photoshop to give it your personal touch.

Ornate Typographic Illustration

Here we get a very decorative and organic look.

Sunset Type

Use multiple programs to create a warm and sunny typographic treatment. Use C4D to create the text, Illustrator for several decorative motifs, and Photoshop to bring them all together.

Flowers Text

Simple yet effective and beautiful text that can be modified to your personal taste.

Stylish Floral Typography

It only takes about 15 minutes to get this floral typography effect. Its quick, easy and simple. Play around with other floral brushes or add more elements if wanted.

Playful Robust 3D Letter Design

For advanced beginners we’ll explore how to create 3D text and use depth-of-field to enhance a design.

5 minute Floral Type in Fireworks and Photoshop

The entire text-effect will be done in Fireworks, then Photoshop is used to add some texture and an old paper effect.

Shiny Calligraphy

Create a nice 3D effect using a calligraphy font and layer styles. You will also have a look at how to create patterns and light effects with blend modes.

Smashing Your Creative Block

Learn how to use the simple tools of Photoshop to your advantage and create a striking text effect.

Grunge

Create an awesome grungy text effect that can be used to liven up your website layouts, display logos and so on.

Dream Design with 3D Typography

The word “Dream” dictates the layout and trees will grow out of the letters. Mountains will show themselves behind the word and overshadow the glowing moon.

Masking with type

How to use masked images with typography to create an eye-catching illustration.

Typographic Concept Poster

Create a typographic poster design with a grungy feel to it. Experiment with your own textures and pictures for a different style.

Unique 3D Text

Use Xara 3D to get a 3D text effect, then export the text to Photoshop and add some style there.

Lost in Space

Create an easy and quick text effect in Photoshop. Play with Brushes, Blend Modes, basic filters and eventually the text.

Trendy Retro Type Treatment

Create a trendy retro type treatment with a free font, gradients, blends, and some scatter brushes.

Create and Then Shatter a Grid, while Making a Typographic Poster

Here we will make a dark and grungy typography poster in Photoshop and Illustrator.

Quick and Easy typographic wallpaper

Create complex works with minimal effort, experiment and create your own unique version of this wallpaper quite easily.

Ancient-style typography

In this tutorial, you will learn to create this cool, ancient-style typography using dry soil texture and floral brush set in Photoshop.

3D Typography

A very time-consuming, but fun tutorial to make a stunning and detailed 3d text.

Typographic Portrait

This effects look nice on portraits with good contrast and light background, but you can easy adjust the contrast and make the background lighter using possibilities of Photoshop beforehand.

Evil Text

Create some very evil, bloody, gory text that even has snake horns and skulls in it.

Typographic Retro Space Face

Make a typographic face by using simple techniques. Using the Brush Tool and experimenting with light, you will get this amazing typographic Space Face.

Graffiti

Use Cinema 4D and Photoshop CS4 to make graffiti letters. Extrude the letters and tweak them out. After the baseline render is done you import it into Photoshop and add some outer strokes and grime.

Flat 3D

In this tutorial you will learn how to create some flat 3D using only Photoshops brush tool.

Poster from Words

Make your own cool music inspired poster from words.

Recessed Watercolor Typography

Learn to mix vector elements and watercolor effects with text to create a stunning design. It’s a quick process that depends heavily on good choices of images and colors.


article from : links

10 amazing open source web analytics

Web analytics basically is a method to determine the behavior of website visitors. In addition to knowing what is often read by a visitor, you can use the information collected from web analytics to maximize advertising revenue from pay-per-click, increased clicks on an email campaign, or even increase your search engine rankings.

Lots of web analytics that can be used by your website, from the open source until paid. In this article we’ve collected 10 amazing open source web analytics you can use. And because the tool is open source, you can freely modify it according to your needs.

TraceWatch


TraceWatch is an open source web analytics That application works in real-time. In addition to easy use, this application can also making a deep analysis of websites (like visitors, browsers, referrers, pageviews, robots, and much more). TraceWatch can be used by way of private and/or public stat report pages.

SlimStat

SlimStat is an open source web analytics application that built with PHP-MySQL and also can be integrated into websites with JavaScript (like Google Analytics) or PHP.

Piwik


Piwik is an open source application site that offers analysis of the detailed statistics about visitors, both his keywords or pages in real-time. Piwik can run properly on a PHP-MySQL server and works similarly to Google Analytics , insert tracking code in the site

Open Web Analytics

Open Web Analytics is an open-source framework that can be used to integrate web analytics into any application. Open Web Analytics built with PHP and has a built-in support for Wordpress, Gallery & MediaWiki.

W3Perl

W3Perl is logfile analysis is based on parsing logfiles. W3Perl distributed under GPL license. In order W3Perl can walk, requires a configuration file that can be built from a web interface. W3Perl available features and complete with a brief explanation of all the scripts. W3Perl also has a glossary that will help you understand your report

CrawlTrack

CrawTrack is an open source web analysis of a very good alternative to Google Analytics software. CrawTrack provide a deeper insight by providing unique statistics for your site. For example, CrawlTrack can help you to protect your site with a lot of blocking code injection or SQL injection tentatives.

BBClone

BBClone is a web counter that gives a detailed view of your web site visitors and the data they provide, such as their IP, web browsers and others that visit the web site, not only indicates the number of pengunjung.BBClone written in PHP and is very useful for webmasters who want to see anyone who visits their site, what browser people use, where they came from, etc.

PhpMyVisites


PhpMyVisites is a software for websites statistics and audience measurements. PhpMyVisites distributed under the GNU / GPL. PhpMyVisites give much information about site visitors, visited pages, software / hardware utilization, etc.. PhpMyVisites has a GUI interface is fun and practical. Also, this installation is fully automatic and very simple.

AWStats

AWStats is an open source web analysis is a powerful and feature rich so that it can produce a sophisticated analysis, ftp, streaming or mail server statistics. AWStats works as a CGI or command line and shows you all information your log contains possible

Grape

Grape is open source and free program that allows web developers to keep accurate statistics of the visitors. Grape has a simple interface with a limited though useful subset of all data can be collected related to demographics of your visitors


from reencoded.com 10 amazing open source web analytics (author denbagus)