Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] How to get the USERNAME from registration in the tpl_general_message file
#2

(10-23-2015, 04:11 AM)IeMdev Wrote: Hi,
I have an application based on Codeigniter 3, however, the controllers are encrypted with ironcube.

For integration reasons with another app I need to get and store in a session var the 'username' that is submitted when a new account is registered and use this value in the tpl_general_message file that loads with the congratulations message.

In V2 of Codeigniter was was able to achieve this by simply adding to the Form Helper file:

Code:
if(isset($_POST['username'])){
    $_SESSION['jamUsername'] = $_POST['username'];
}

However, it does not seem to be working with V3 so now things are broken. There is no value for $_POST['username'] at this point of the process.

Any better ways of getting this value?

Thanks

You modified system form_helper file?

I think the correct way to do this is the following:

At controller that you use to auntenticate for example Auth at login action you can make the following (assuming you have to check the username and password and have a model for it):


PHP Code:
if ($this->input->post('username') && $this->input->post('password')) {
  if($this->auth_model->checkUser($this->input->post('username'), $this->input->post('password'))) {
    $this->session->set_userdata('jamUsename'$this->input->post('username'));
  }

Greetings.
Reply


Messages In This Thread
RE: How to get the USERNAME from registration in the tpl_general_message file - by rtorralba - 10-23-2015, 04:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB