Welcome Guest, Not a member yet? Register   Sign In
Need help with User Profile
#1

[eluser]Zonyk[/eluser]
Hey guys,

I am working on a cms and need help by reading from the database for a userprofile.

thats my login code:
Code:
<?php
  
class Login extends Controller {

     function index()
     {
        $data ['main_content'] = 'login_form';
        $this->load->view('includes/template', $data);
     }
    
     function validate_credentials()
     {
         $this->load->model('membership_model');
         $query = $this->membership_model->validate();
        
         if($query)
         {
            $data = array (
                'userid' => $this->input->post('userid'),
                'email_address' => $this->input->post('email_address'),
                'is_logged_in' => true
            );
              
            $this->session->set_userdata($data);
            redirect ('site/home');  
         }
                    
         else
         {
            $this->index();
         }
     }
    
      function create_member()
     {
         $this->load->library('form_validation');
         //field name, error message, validation rules
        
         $this->form_validation->set_rules('first_name', 'Vorname', 'trim|required');
         $this->form_validation->set_rules('last_name', 'Nachname', 'trim|required');
         $this->form_validation->set_rules('email_address', 'E-Mail Addresse', 'trim|required|valid_email');
        
         $this->form_validation->set_rules('userid', 'UserID', 'trim|required|min_length[4]');
         $this->form_validation->set_rules('password', 'Passwort', 'trim|required|min_length[6]|max_length[32]');
         $this->form_validation->set_rules('password2', 'Passwort wiederholen', 'trim|required|matches[password]');
        
         if($this->form_validation->run() == FALSE)
         {
             $this->signup();
         }
         else
         {
             $this->load->model('membership_model');
             if($query = $this->membership_model->create_member())
             {
                 $data['main_content'] = 'signup_successful';
                 $this->load->view('includes/template', $data);    
             }
             else
             {
                $this->load->view('signup_form');  
             }
         }        
     }
}
?>

how can i build a profile for a single logged in user?

thank you for your answers!
#2

[eluser]mi6crazyheart[/eluser]
Quote:"how can i build a profile for a single logged in user ?"
Hey i'm little bit in doubt what actually u want. Do u mean, how to extract user info from DB & how to show in VIEW page or something else... ?
#3

[eluser]Zonyk[/eluser]
Yes, that is it. Smile
I want for every user a profile page but i dont know how i can do this with the session.
"www.pallcard.net/site/profile/userid"




Theme © iAndrew 2016 - Forum software by © MyBB