2009六月23
传统的Ajax可以实现php与JavaScript之间的交互,这里略过这种方法总结一下其它途径。
采用隐藏标签的方式
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html...[查看全部]
2009六月19
夜,枕着大地睡了
月亮,踩着云端俏皮地跳来跳去
风和花儿轻轻的呢喃
美丽的天使也瞪着眼睛,嫉妒地看着那位幸福的姑娘
睡梦中
她笑了,因为开心
她乐着,因为幸福
沉沉的夜色中响起一曲浪漫的歌谣
快乐吧,因为尽情投入爱中
一簇黑云掩埋了月亮
夜,在黑暗中不安
姑娘,在惊恐中颤栗
大地掠过一股令人窒息的空气
空中骤然响起一阵急促的铃声
离去的初恋女友从远方回来了
拖着疲惫和脆弱的身体
随时晕倒在走过的路上
求救的信号...[查看全部]
2009六月18
?
加上这样一句话:
<param name=”quality” value=”high”>
<param name=”wmode” value=”Opaque”>
或者这样:
<embed src=”images/new.swf” quality=”high” wmode=”Opaque” width=”1006″ height=”586″></embed>
在做web开发中可能会遇到flash遮挡页面中元素的情况,无论怎么设置flash容...[查看全部]
2009六月16
When you have some functionality that needs to be shared across multiple controllers, one method is to use action helpers. Action helpers are very powerful and contain hooks to automatically run when you need them too, but you can ignore all that if you don’t need it.
The first thing you need to do is decide where to put them. The latest default project structure document recommends using...[查看全部]
2009六月16
Now that Zend Framework 1.7 has been released, I thought I’d take a look at the built in file upload element, Zend_Form_Element_File, and see how it can be used. This is how to use it in its most basic form.
I decided to use the same set of form elements as before in order to make things easy.
Let’s start with the form:
The form
We extend Zend_Form and store it in the application/...[查看全部]
2009六月15
Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. This technique will produce more responsive applications than classic AJAX. In classic AJAX applications, web browser (client) cannot be notified in real time that the server data model has changed. The user must create a request (for example by clicking on ...[查看全部]
2009六月15
为了安全要将Apache及 PHP 的版本隐藏防止XXX人无聊时xxx
,可以用以下方法:
Apache:
开启 httpd.conf,加入以下两行:
ServerTokens ProductOnly
ServerSignature Off
PHP: 隐藏 PHP 版本就是隐藏 “X-Powered-By: PHP/5.1.2-1+b1″ 这个,开启 php.ini,加入: expose_php = Off 完成以上两个设定后,重新启动 Apache 即可。
另外,讲几个最基本的php的安全设置
禁用某些危险函数
disable_functions = system,exec,sh...[查看全部]
2009六月15
MYSQL查询技巧
[插入时唯一索引冲突则变为更新]
mysql的insert语句有一个比较少见的可选子句: ON DUPLICATE KEY UPDATE col_name=expr, …
用法是:
INSERT INTO table (a,b,c) VALUES (1,2,3) ? ON DUPLICATE KEY UPDATE c=c+1;
例如,如果列a被定义为UNIQUE,并且包含值1,则执行以上语句与下面的结果一样
UPDATE table SET c=c+1 WHERE a=1
即插入时使唯一键冲突,则会执行update语句,where条件为该冲突的键值
[同时删除两...[查看全部]
2009六月15
php的长连接是实现php即时通信的一个不错的选择,下面的代码在firefox中可以显示出效果,在IE中还要改进。
[查看全部]