session_register(string variable name): 将一个变量存入session() 会话的键/值对通过对$_SESSION 数组赋值来创建或修改。
How can the value of a form element be accessed by a PHP script?
无论form使用GET还是POST方法,PHP为任任意一个元素建立一个同名变量。这个变量可以直接被PHP使用。他叫做外部变量。
推荐的方法是使用隐含的数组,$_POST 和$_GET,来存储表单值。这些数组的键与表单元素名称匹配,值和客户输入的值匹配。
Understand and remember the so‐called Three‐ tier structure.
三层体系结构:第一层是web 浏览器,它提供了用户接口;中间层通常具有web 服务器以及需要访问数据库的应用程序;第三层具有数据库服务器和数据库本身。
Carefully review the procedure you have carried through that enables your Apache server to support PHP. (1) mkdirphp
(2) tar ‐xjf php‐5.0.5.tar.bz2 to un‐tar it. The suffix bz2 means another compression format. A j option is needed to run the un‐tar. (3) ./configure
‐‐prefix=/home/2009/y2009g0/php
‐‐exec‐prefix=/home/2009/y2009g0/php ‐‐with‐mysql
‐‐with‐apxs2=/home/2009/y2009g0/apache/bin/apxs
The '‐‐prefix' specify where the PHP system locates, the '‐‐with‐mysql' tells that we are going to access MySQL database, the '‐‐with‐apxs2' specify the file name which keep all information about the Apache Server, the ending 2 say that you are using Apahce of version 2.0 or higher. (4) make
(5) make install
(6) check if there is a file named libphp5.so in the directory ~/apache/modules (7) Edit the configuration file of Apache httpd.conf .
LoadModule php5_module modules/libphp5.so //which tells the apache to load the PHP module when it is started.
AddType application/x‐httpd‐php .php //Which tell Apache that files with a .php suffix are PHP script.
(8) Copy a sample php.ini to this directory by executing the following command: cp ~/php‐5.0.5/php.ini‐dist ~/php/lib/php.ini
(9) Edit this ~/php/lib/php.ini file, turn on the switch register_globals =On. By doing this, in PHP program, you can directly access those valuse of Form fields and Cookie variable as a common PHP variable by refering the name. (10) Stop the Apache Server by runing: apachectl stop and start it by runng: apachectl start (11)
Remember the three fundamental changes that blog brings to Web. (1) From Readable to Writable
Before Blog, from the viewpoint of a common Web user, the Web is Build(Written) and Updated by some professionals who expert in Web Wide Web. Web is just a tremendous information resources which can be refered to. After Blog, Web becomes writable for general users, they can easily build their own blogs, wirte Posts and Comments on other posts. Helped by some technlogies, such as CSS, XML which separate the content of the Web from the presentation of Web, the writing of the Web focus on the content. The threshold for creating a nice Web site is dramatically lowered.
在blog出现前,对于一个普通的web使用者,web是被专业人员建设和升级的。web仅仅是一个巨大的信息源。在blog出现后,web可以被普通人编写,他们可以很容易建立自己的blog,写文章和评论别人的问斩,在CSS,XML的帮助下,web文章的编写者可以专注于文章本身。建立一个好的web的门槛变得很低 (2) From Pull to Push
With this Push mechanism, a user can subscribe to some Web sites he or she is interested and regularly receive page‐updates pushed by those Web sites. Obviously, it is not reasonable to always push the whole web page. There must be some syndication and briefing technologies. VSS or ATOM can be be classified as this kind of technology. The brief updates are also called Blog feed. User use RSS Aggregator to receive the Blog feeds.
在PUSH机制的帮助下,用户可以订阅网站的内容并且定期收到网站push的信息。VSS和ATOM就是这种技术。这种基本的升级也叫做blog feed。用户用RSS聚合器接受blog feeds。 (3) Form one‐way link to two‐way reference
\means the following nature of traditional World Wide Web: Page A includes a hyper‐text link which points to page B, while page B knows nothing about this reference. Track Back and Ping Back used to build a backward link from page B to page A. Page B could be a comment on Page A. Page B resides on a separate Host. This is also called remote commenting. 单向是说在传统的web中,页A有一个超链接但想到指向页B,但是页B并不知道这个链接。track back和 ping back用于建立一个从B到A 的链接。B可以是A的一个评论。页B属于一个独立的Host。这也叫远程评论
Could classify technologies accordingly.Post and Comments, CSS, XML, ATOM, RSS, Content aggregation.
(1) From readable to writable: Posts and Comments; CSS, XML (2) From pull to push: VSS or ATOM; RSS
(3) From one‐way link to two‐way reference: Trackback; Content aggregation
What is wiki
一种多人协作的写作工具。Wiki 站点可以有多人(甚至任何访问者)维护,每个人都可以发表自己的意见,或者对共同的主题进行扩展或者探讨。Wiki 也指一种超文本系统。这种超文本系统支持面向社群的协作式写作,同时也包括一组支持这种写作的辅助工具。