RalphLeMouf Posted July 12, 2012 Author Share Posted July 12, 2012 which error logs do you need to see off of my MAMP module? Or do you need to see stuff from my logs folder on CI? Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361097 Share on other sites More sharing options...
RalphLeMouf Posted July 12, 2012 Author Share Posted July 12, 2012 I just got it! I noticed on config.php that enable query strings was set to false. I set it to true and it worked. loaded the wrong page and /validate_crendentials was in the url but that's a step. In the meantime I was starting to transfer my files to the latest version. Do you think I'm ok working on 2.0.3 or should I continue to transfer it to 2.1.1? thanks again for all of this help! Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361102 Share on other sites More sharing options...
RalphLeMouf Posted July 12, 2012 Author Share Posted July 12, 2012 it's actually defaulting to the index page when I hit submit no matter if the fields are filled out or not. It seems like a step in the right direction though Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361103 Share on other sites More sharing options...
Mahngiel Posted July 12, 2012 Share Posted July 12, 2012 Do you think I'm ok working on 2.0.3 or should I continue to transfer it to 2.1.1? I highly recommend you do so. Releases exist for a purpose (primarily to fix bugs and insecurities). You'll be jumping two releases, so you need to follow both of these steps: http://codeigniter.com/user_guide/installation/upgrade_210.html http://codeigniter.com/user_guide/installation/upgrade_211.html it's actually defaulting to the index page when I hit submit no matter if the fields are filled out or not. It seems like a step in the right direction though Check your form_open to see where it points and then check that controller/method to see if is anything that would cause problems. Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361128 Share on other sites More sharing options...
RalphLeMouf Posted July 12, 2012 Author Share Posted July 12, 2012 great! Thanks. I'll keep you posted on what unfolds! Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361132 Share on other sites More sharing options...
RalphLeMouf Posted July 13, 2012 Author Share Posted July 13, 2012 I have gone back to the most stripped down version of logging in an user. The form open location is "auth/validate_credentials" as that seems logical. Moreover when I take that out. After hitting submit on the login page it takes me to the index.php ( default view ) no matter what! I also did the updates. Here is what I currently have: Model: <?php class User_model extends CI_Model { function validate() { $this->db->where('email', $this->input->post('email')); $this->db->where('password', sha1($this->input->post('password'))); $query = $this->db->get('users'); if($query->num_rows == 1) { return true; } } } View: <title>Login</title> <!--MAKE SURE SIGNED OUT HEADER IS IMPLEMENTED FOR ALL SIGNED OUT PAGES INCLUDING THIS ONE--> <div class="structure clearfix"> <h1 class="title_header"> Sign In </h1> <div id="signin_form"> <?php echo validation_errors(); echo form_open('auth/validate_credentials'); echo "<div class='form_text_signin'>"; echo "Email"; echo "</div>"; echo form_input('email'); echo "<div class='form_text_signin'>"; echo "Password"; echo "</div>"; echo form_input('password'); echo form_submit('submit', 'Submit'); echo form_close(); ?> </div> </div> Controller: <?php class Auth extends CI_Controller { function __construct() { // Call the Model constructor parent::__construct(); } // this is automatically called if no other function is called // it simply turns around and calls the login() function to show the login page public function index() { $this->login(); } public function login() { $data['main_content'] = 'auth/login'; $this->load->view('includes/templates/main_page_template', $data); } function validate_crendentials() { echo "<pre>"; $this->output->enable_profiler(TRUE); echo "</pre>"; $this->load->model('user_model'); $this->user_model->validate(); if($query) { $data = array( 'email' => $this->input->post('email'), 'is_logged_in' => true ); $this->session->set_userdata($data); redirect('account/dashboard'); } else { $this->index(); } } } Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1361410 Share on other sites More sharing options...
RalphLeMouf Posted July 17, 2012 Author Share Posted July 17, 2012 Ok - this is getting a little despressing :'( haha I went ahead and just tried to transfer all of my files to version 2.1.2 and not worry about updating my current files twice because I was two version behind. I am STILL having data base issues from the get go. A Database Error Occurred Unable to connect to your database server using the provided settings. Filename: core/Loader.php Line Number: 346 and here is that line in my files: require_once(BASEPATH.'database/DB.php'); if ($return === TRUE) { return DB($params, $active_record); } // Initialize the db variable. Needed to prevent // reference errors with some configurations $CI->db = ''; // Load the DB class $CI->db =& DB($params, $active_record); } Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1362188 Share on other sites More sharing options...
Mahngiel Posted July 17, 2012 Share Posted July 17, 2012 Unable to connect to your database errors stem from your config/database.php file. Either your database chosen, the path to it, user name, or password are incorrect. Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1362199 Share on other sites More sharing options...
RalphLeMouf Posted July 17, 2012 Author Share Posted July 17, 2012 right - that is my concern. it very well should be: $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = 'root'; $db['default']['database'] = 'cysticlife_CI'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1362250 Share on other sites More sharing options...
Mahngiel Posted July 17, 2012 Share Posted July 17, 2012 What you posted is only half of the solution, of course - as you must ensure you have a database running that accepts those parameters. This thread, however, has lost it's scope, and if you desire further general assistance, you can PM me and we can set up a training session for a reasonable cost. Else, please hone in on a specific issue and the community may be able to aide you. Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1362276 Share on other sites More sharing options...
RalphLeMouf Posted July 17, 2012 Author Share Posted July 17, 2012 ok. Np. Thanks for all your time. Quote Link to comment https://forums.phpfreaks.com/topic/265436-fatal-error-call-to-a-member-function-where-on-a-non-object/page/2/#findComment-1362309 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.