日期:2014-05-17  浏览次数:20392 次

继承父类的时候 __construct报错误。
php, __construct, post
继承父类的时候 __construct报错误。
w
class a{
  function __construct(){
  $this->post();
  }

  function post(){
  //$_POST
  }
}

子类b.php
class b extends a{

  //默认父类__construct()

  functoin index(){
  //
  }
}

问题,在用get浏览b.php文件时,能正常浏览,用post提交数据时,报错,
post数据,在注册父类的__construct,或者复写子类的__construct后就正常。。


------解决方案--------------------
汗... 那还不结贴?