narjis Posted February 26, 2011 Share Posted February 26, 2011 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 Quote Link to comment Share on other sites More sharing options...
SaMike Posted February 26, 2011 Share Posted February 26, 2011 you need double _ function __construct(blahblah){ instead of function _construct(blahblah){ Quote Link to comment Share on other sites More sharing options...
trq Posted February 26, 2011 Share Posted February 26, 2011 A construct start with __ not _ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.