usage of PHP classToday we have a basic usage of PHP class to tell you, first of all you understand what is a class: the definition of a class is as follows:
With uniqueness, flexibility, versatility, importance, which is defined by, and more detailed to the www.111cn.cn view is, well, in order to let everyone know more clearly what is oop we will come to the example.
Class user{
var $u _uid; Username ID 中文版
var $u _mbname; Use Temptlete
var $u _css; Document Stylewww.111cn.cn
var $u _documentbg; Full Document background
var $u _csstop; Doucument Top Background
var $u _cssbottom; Bottom background
var $u _realname; Username Realname Chinse
var $u _id; TableName ID replace tag;
var $u _edu;
var $u _work;
var $u _head;www.111cn.cn
var $u _sitename;
var $u _visited;
var $u _blog;
var $host;
function UserInfo ($id) {
$id = $this->safe_function ($id);
if (Empty ($id) | |!is_numeric ($ID)) {exit ("");}
$sql = "SELECT * from Uidname where u_id= ' $id '";
$result = mysql_query ($sql) or Die ("Error system busy.....plase wait!");
if (mysql_num_rows ($result)) {
$rs = Mysql_fetch_object ($result);
$this->u_id = $rs->id;www.111cn.cn
$this->u_uid = $rs->username;
$this->u_realname = $rs->realname;
$this->U_DOCUMENTBG = $rs->documentbg;
$this->u_csstop = $rs->csstop;
$this->u_cssbottom = $rs->cssbottom;
$this->u_mbname = $rs->mbname;
$this->u_edu = $rs->edu;
$this->u_work = $rs->works;
$this->u_sitename = $rs->sitename;
$this->u_visited = $rs->visited;
$this->u_blog = $rs->u_id;
}else{
Header ("location:blog/error.php"); exit;
}
}
}
Note: This site original www.111cn.cn
http://www.bkjia.com/PHPjc/631375.html www.bkjia.com true http://www.bkjia.com/PHPjc/631375.html techarticle PHP Class Usage Today we are going to use the basic usage of PHP class to tell you, first of all, you understand what is a class: the definition of a class is as follows: Unique, flexible, universal, importance, this ...