php学习日记(一)
时间:2006-05-06 来源:charloco
header 应用:在使用header之前一定不能有任何的输出,类似于echo ,print 也不能有html语句。否则会出现,header has been sended 的错误提示
session篇:
简介:
Session support in PHP consists of a way to preserve certain data across
subsequent accesses. This enables you to build more customized applications and
increase the appeal of your web site.
A visitor accessing your web site is assigned a unique id, the so-called
session id. This is either stored in a cookie on the user side or is propagated
in the URL.
----------------------------------------------------------------------
session_start() initialize session data,
session_start()creates a session or resumes the current one based on the current session id that's being pasted via a request such as
GET,POST,or a cookie.
//page1.php
//page2.php
--------------------------------------------------------
注意在使用session时,要注意同header相同的问题(上有描述)
在一些网上下载的源程序中还能发现session_register(..)函数。
-------------------------------------------------------------
session_register() accepts a variable number of
arguments, any of which can be either a string holding the name of a variable or
an array consisting of variable names or other arrays. For each name,session_register() registers the global variable with
that name in the current session.
session_refister() 的使用依赖于register_globals=on但是自php 4.2.0起,这一选项被默认设置为off.
you'd better use $_SESSION instead of session_register().
session篇:
简介:
Session support in PHP consists of a way to preserve certain data across
subsequent accesses. This enables you to build more customized applications and
increase the appeal of your web site.
A visitor accessing your web site is assigned a unique id, the so-called
session id. This is either stored in a cookie on the user side or is propagated
in the URL.
----------------------------------------------------------------------
session_start() initialize session data,
session_start()creates a session or resumes the current one based on the current session id that's being pasted via a request such as
GET,POST,or a cookie.
//page1.php
//page2.php
--------------------------------------------------------
注意在使用session时,要注意同header相同的问题(上有描述)
在一些网上下载的源程序中还能发现session_register(..)函数。
-------------------------------------------------------------
session_register() accepts a variable number of
arguments, any of which can be either a string holding the name of a variable or
an array consisting of variable names or other arrays. For each name,session_register() registers the global variable with
that name in the current session.
session_refister() 的使用依赖于register_globals=on但是自php 4.2.0起,这一选项被默认设置为off.
you'd better use $_SESSION instead of session_register().
相关阅读 更多 +