Tag Archives: variable

Variable transmission Between two pages in php

Posted on 15. Feb, 2009 by Yao Yuan.

0

在网站设计中,我们常常用到用户登陆这一方法,在登陆后,一般的网站都会根据不同的用户来给定不同的页面,在链接到该站的一个新的网页或者打开一张新网页时,我们也会看到用户的信息能够被记住,现在尤其常用的是,登陆后链接或打开该站的其它网页都会看到诸如”XXX,晚上好”之类的问候语,这些当然都是在登陆后变量传送的结果,在我做个人主页的过程中,曾尝试几种变量传送的方法,现写出来与大家探讨一下。 [...]

Continue Reading

superglobals variable

Posted on 15. Feb, 2009 by Yao Yuan.

0

In PHP 4.2.0 and later, the default value for the PHP directive register_globals is off. This is a major change in PHP. Having register_globals off affects the set of predefined variables available in the global scope. For example, to get DOCUMENT_ROOT you’ll use $_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from the URL http://www.example.com/test.php?id=3 instead of $id, or $_ENV['HOME'] instead of $HOME.

For related information on this change, read the configuration entry for register_globals, the security chapter on Using Register Globals , as well as the PHP » 4.1.0 and » 4.2.0 Release Announcements.

Using the available PHP Reserved Predefined Variables, like the superglobal arrays, is preferred [...]

Continue Reading

variable variable, PHP and you

Posted on 14. Feb, 2009 by Yao Yuan.

0

什么叫作变量的变量?根据PHP手册,变量的变量是指取得一个变量的值并把它作为另一个变量的变量名。这表述显得相当的直接,容易和那些在一个句子中使用 “变量”这个词弄混淆。给一个简单的例子,你定义一个变量 — x 等于 this — 然后定义一个变量的变量,意味着你把 x 的值作为新变量的名,在这个例子中,这个新变量的值是 is cake。用PHP来表示如下: [...]

Continue Reading