Welcome Guest, Not a member yet? Register   Sign In
login using code igniter & doctrine
#11

[eluser]Randy Casburn[/eluser]
Your posts explain who you are.
#12

[eluser]newbie boy[/eluser]
what is wrong with this picture?
#13

[eluser]newbie boy[/eluser]
anyone?
#14

[eluser]newbie boy[/eluser]
pls! i really need help on this one!
#15

[eluser]newbie boy[/eluser]
still waiting . . .
#16

[eluser]nizsmo[/eluser]
Have you tried searching on google?
http://www.google.co.nz/search?source=ig...earch&meta;=

People here will try to help in any way they can, but I don't think anyone will write code for you. A good way is to write some code, and ask a few questions on why it isn't working, and what may be causing the problem. If you have some code already, try to debug it and see exactly what the problems are.

Goodluck Smile
#17

[eluser]Bramme[/eluser]
http://www.google.com/search?hl=en&q=cod...oeken&meta;=
#18

[eluser]newbie boy[/eluser]
I tried this option but still doesn't work.


Code:
here's my new controller:

function index()  {
                    
    $isValid     = true;
                
        $email        = $this->input->post('email');
    $password     = $this->input->post('password');
                                
    if (empty($email))     { $isValid = false; }
    if (empty($password))     { $isValid = false; }
                    
    if ($this->session->userdata('logged_in') == '0') {  
                
    if ($isValid) {
                    
    $UserModel = Doctrine_Query::create()
        ->select('u.*')
        ->from('UserModel u')
        ->where('u.email=? AND u.password=?',array($email,$password))
        ->fetchone();
                    
    $data['username'] = $email;
                            
    $this->session->set_userdata('logged_in', '1');
    $this->session->userdata('email');
    redirect('HomeProfileController',$data);        
                    
    } else {
                    
    redirect('HomeController','refresh');        
                    
    }
                    
   }        


  }
}
#19

[eluser]Pascal Kriete[/eluser]
I'm with Rick on this, you need to take a big step backwards and think about what you're doing. The code has numerous logic flaws. Having a username and password doesn't mean they're right. And merely querying a database doesn't do anything, you need to evaluate the results.

Forget about doctrine for the time being. Make a small test application that works with clean php+mysql. Once you have that, start to reintegrate the ORM.
#20

[eluser]newbie boy[/eluser]
here's my code without using the doctrine and this work perfectly but my problem is how will change this code in line with the doctrine like the first code i posted, really not working.

Code:
function index(){
        
        $rules['email'] = "required";
        $rules['password'] = "required";
        
        $this->validation->set_rules($rules);
        $this->validation->set_error_delimiters('<div id="errors">', '</div>');
        
        $fields['email'] = 'Email';
        $fields['password'] = 'Password';
            
        $this->validation->set_fields($fields);
        
                   // Check validation . . .
                              
                if ($this->session->userdata('logged_in') == '0') {            
                                
                    if ($this->validation->run() == TRUE)    {

                        $email = $this->input->post('email');
                        $password = md5($this->input->post('password'));
                        
                        // Check input against database . . .
                        
                        $this->db->where('email', $email);
                        $this->db->where('password', $password);
                        $query = $this->db->get('user_model');
                        $result = $query->num_rows();
                    
                        if (isset($result) ? $result != 1 : NULL) {
                            
                            $data['errors'] = "The email and password you submitted was not found in our database.";

                            $this->load->view('login_form', $data);
                                  
                        } else {
                            
                            $this->session->set_userdata('logged_in', '1');
                            $this->session->userdata('email');
                              $this->load->view('userPreview','refresh');
            
                        }
                    
                    } else {
                        
                        $this->load->view('login_form');
                        
                    }    
        
            } else {
                
                $this->load->view('login_form','refresh');        
            }
    
    }




Theme © iAndrew 2016 - Forum software by © MyBB