最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php OOP类的用法
时间:2008-05-22 编辑:简简单单 来源:一聚教程网
php类的用法 今天我们就php class用基本用法来讲述一下,首先要你明白什么是类:类的定义如下:
具有独特性,具有灵活性,具有通用性,重要性,这是等的定义了,更详细的内容各位到www.111com.net查看就是了,好了为了让大家能更清楚的了解什么是OOP我们就来例子.
Class user{
var $u_uid; //username id english
var $u_mbname; // use temptlete
var $u_css; //document stylewww.111com.net
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.111com.net
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.111com.net
$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;
}
}
}
注意:本站原创www.111com.net
-
上一个: in_array函数的用法
-
下一个: cookie用法
相关文章
- PHP通过反射方法调用执行类中的私有方法 06-14
- php中接口、抽象类、Final、Static例子 05-08
- PHP中抽象类和接口的区别与例子 05-08
- php抽象类与接口的区别详解 04-09
- php反射类 ReflectionClass使用例子 03-13
- PHP抽象类和接口示例和区别 11-20