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后就正常。。
继承父类的时候 __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后就正常。。
解决方案 »
- php168分类系统的首页导航栏的问题!请熟悉php168的讲解下,最好每行代码后面加上注释。
- 关于用Destoon B2B系统的进来看下
- phpMyAdmin不能连接到mysql上
- [求助!!]如何把wordpress的数据库连接修改为我自己配置的文件:app_config.php中的链接.
- PHP 开发企业建站系统【木子建站系统】 开源
- 一个电子公告板(紧急)有报酬!
- 我把linux虚拟空间的内容都删了,再添加其他页面的时候出现了下面错误时怎么回事?
- php推送消息到IOS
- tcexam不能输入试题
- TortoiseGit 64位 安装一直失败
- 谁有积分商城的源码共享?哪些开源团购网站带有积分商城功能?
- 分享:我的php框架再次更新,山寨版thinkphp,开发效率再次大幅提升
<input type=submit name=submit value=ok>
</form>
<?php
class a{
function __construct(){
$this->post();
}
function post(){
print_r($_POST);
}
}class b extends a{
function index(){
}
}new b;
没有发现你说的现象,请检查其他部分
我需要的是访问b.php,
b.php是一个可以浏览的页面。。
数据操作都在b.php文件里面进行。。
http://xxx.com/b.php 来进行访问.class b extends a{
function index(){
$date = $this->post();
$this->view->assign('data', $data);
$this->view->display('b.html');
}
}
这与我写在一起是一样的
恩。这个是框架正确访问地址是:http://xxx.com/b/index/所以你的方法不照。