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

[eluser]newbie boy[/eluser]
hi everyone! Can you help me make a login form using code igniter and doctrine? thanks!
#2

[eluser]manilodisan[/eluser]
Help how? You want the code written? TongueP
#3

[eluser]newbie boy[/eluser]
yes, all i need is the code for the controller! thanks again!
#4

[eluser]manilodisan[/eluser]
I too want to build a search engine! Will someone PLEASE PLEASE PLEASE send me the code? (please get the irony! Tongue)
#5

[eluser]newbie boy[/eluser]
Code:
here's my 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 = new UserModel();
    $UserModel = Doctrine_Query::create()
        ->select('u.*')
        ->from('UserModel u')
        ->where('u.user_id = ?', $email)
        ->fetchone();
                    
    $data['username'] = $email;
                            
    $this->session->set_userdata('logged_in', '1');
    $this->session->userdata('email');
    redirect('HomeProfileController',$data);        
                    
    } else {
                    
    redirect('HomeController','refresh');        
                    
    }
                    
   }        


  }
}

The code is messy. What's the proper way to do it? Sorry for the code tags! Thanks!
#6

[eluser]newbie boy[/eluser]
My controller is only working for the an empty input but if there's an input it will always direct me to the HomeProfileController! What can be the solution so that it will check first at the database if there's a matching record! Thanks again! Sorry for the stupidity!
#7

[eluser]manilodisan[/eluser]
Use form validation instead of redirects. Check the form validation library.
#8

[eluser]newbie boy[/eluser]
NEEDY BOY: I too want to build a search engine! Will someone PLEASE PLEASE PLEASE send me the code? (please get the irony! raspberry)

IRONIC BOY: Oh, that's easy use the code igniter!(also please get the irony! raspberry)

Will someone be more elaborately helpful?
#9

[eluser]Rick Jolly[/eluser]
[quote author="newbie boy" date="1224746818"]
Will someone be more elaborately helpful?[/quote]
Not me. There are several problems with your code. You haven't put in the effort.
#10

[eluser]newbie boy[/eluser]
i hope my name can explain who i am!




Theme © iAndrew 2016 - Forum software by © MyBB