_ Construct reports an error when inheriting the parent class. When php ,__ construct and post inherit the parent class, _ construct reports an error. Wclassa {& nbsp; function _ construct () {& nbsp; $ this-& gt; post (); & nbsp ;}& nbsp; functionpost () {_ construct reports an error when & nbsp inherits the parent class.
Php, _ construct, post
_ Construct reports an error when inheriting the parent class.
W
Class {
Function _ construct (){
$ This-> post ();
}
Function post (){
// $ _ POST
}
}
Subclass B. php
Class B extends {
// Default Parent class _ construct ()
Functoin index (){
//
}
}
Problem: When you use get to browse the B. php file, it can be browsed normally. when you use post to submit data, an error is returned,
Post data is normal after _ construct of the parent class is registered or _ construct of the child class is rewritten ..
------ Solution --------------------
Khan... isn't it closed yet?