Jump to content

Recommended Posts

please have a look at the following view and controller file,

PS i have removed the index file using the tutorial given on the ci website

now i get a object not found error.

----- view file

<?php echo form_open('login/validate_credentials'); ?>
				<div id="loging_col">
					<div id="login_head">Anmelden</div>
					<div id="email_address_area">

				<?php	echo form_input('email_address','email');	?>                
					</div>
					<div id="email_password_name">E-mail Address</div>
					<div id="password_area">
					<?php	echo form_password('password','password' ); ?>
            	
					</div>
					<div id="email_password_name">Passwort</div>
					<div id="form_submit">
					<?php echo form_submit('submit', 'Anmelden');  ?>
               </div>

----------------------- this is the controller

class Login extends CI_Controller {

function index()
{
	$data['main_content'] = 'login_form';
	$this->load->view('login', $data);		
}

function validate_credentials()
{		
	     	
    $this->load->model('membership_model');
	$query = $this->membership_model->validate();

	if($query) // if the user's credentials validated...
	{
		$data = array(
			'email_address' => $this->input->post('email_address'),
			'is_logged_in' => true
		);
		$this->session->set_userdata($data);
		//redirect('site/members_area','refresh');
	   $this->load->view('main_baukompass');
	}

	else // incorrect username or password
	{
		$data['main_content'] = 'username or password does not match';
		//redirect('login','refresh');
      $this->load->view('login', $data);
	}

}	

function signup()
{
	$data['main_content'] = 'signup_form';
	$this->load->view('registration', $data);
}

he above code keeps loading the "login/validate_credentials" and says object expected.

 

Link to comment
https://forums.phpfreaks.com/topic/234957-view-not-loading/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.