Jump to content

calling class constructor


narjis

Recommended Posts

I am calling my class constructor with the following code

class controller{
function _construct($name,$pass){
session_start();
get_model_class($name, $pass);
echo "I\'m in controller";

}
} 
function get_model_class($username, $password){
$my_model = new  model();  
$my_model->check_users($username,$password);
}


$username = $_POST['username'];
$password = $_POST['password'];
echo "in controller.php";
$newUser = new controller($username,$password);

but it is not entering the constructor

Link to comment
https://forums.phpfreaks.com/topic/228891-calling-class-constructor/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.