passing variables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: passing variables (/showthread.php?tid=32813) |
passing variables - El Forum - 08-05-2010 [eluser]briggl[/eluser] I have a question that probably has a simple answer but I cannot find it in the doc. Here is the sample code from the Form Validation tuturial Code: <?php Code: $data['username'] = 'username'; Naturally, it just displays 'username' and 'email' instead of what the user (me) entered. I have tried several different ways, such as $username, username without the quotes, etc. What do I need to put in place of 'username' and 'email' to do what I want to do? passing variables - El Forum - 08-05-2010 [eluser]jonyr[/eluser] Hi Briggl, you need to pass the posted variables. Read the input class documentation in http://ellislab.com/codeigniter/user-guide/libraries/input.html Code: $data['username'] = $this->input->post('input_name'); Change input_name with the correct values. passing variables - El Forum - 08-05-2010 [eluser]briggl[/eluser] Thanks, JonyR I got it to work by using $data['username'] = set_value('username') $data['email'] = set_value('email') But now I have a follow-on question. By doing this I can pass the information to the next view, formsuccess. How do I create a global variable so that I can pass the information on to other views after that? Thanks. passing variables - El Forum - 08-06-2010 [eluser]briggl[/eluser] I have resolved this by using session data. |