CodeIgniter Forums
Function does not work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Function does not work (/showthread.php?tid=66915)



Function does not work - Myster - 12-17-2016

Hello,

I have a function to modify the profile, however, it displays "error" instead of "success" I do not know why, here is my code

PHP Code:
 public function modifier_mon_profil($user_id)
 
      {
 
        $userinfo $this->ion_auth_model->profil_user($this->ion_auth->get_user_id());
 
        $this->smarty->assign("meta_titre"'Modification de votre profil');
 
        $this->smarty->assign("meta_description"'Modifiez votre profil');
 
        $this->smarty->assign("info"$userinfo );
 
         
          if 
(!$this->ion_auth->logged_in())
 
           {
 
              redirect('/connexion');
 
           }
 
         if ($this->ion_auth->get_user_id() == $userinfo->id)
 
            

               $this
->form_validation->set_rules('email''<b>E-mail</b>''required');
 
              $this->form_validation->set_rules('sexe''<b>Sexe</b>''required');


 
              if ($this->form_validation->run() == TRUE)
 
                {
 
                      $user_id $this->ion_auth->get_user_id();
 
                      $sexe $this->input->post('sexe');
 
                      $rpgmaker $this->input->post('rpgmaker');
 
                      $biographie $this->input->post('biographie');
 
                      $signature $this->input->post('signature');
 
                      $siteweb $this->input->post('siteweb');
 
                      $email $this->input->post('email');
 
                   if ($this->Ion_auth_model->editprofil($user_id$sexe$rpgmaker$biographie$signature$siteweb$email))
 
                     {
 
                        
                     
echo 'Success'
 
                        
                      
}
 
                     else {
 
                      echo 'Error';
 
                     }

 
 
               
                 
}
 
        

Sorry for my bad english, i speak French, i use Google Translate


RE: Function does not work - InsiteFX - 12-17-2016

This must not be the whole method/function because you have 6 opening braces { and only 4 closing braces }.