Multipage Form using Sessions |
[eluser]bubaphex[/eluser]
Hi guys, Farly new to CI, Trying to a multipage form using sessions. Having trouble bring over the data from page1 to page2 and submitting it into the db Here what i looks like, any help is much appreciate Form Controller Code: <?php View Page 1 Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> View Page 2 Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Model Code: <?php
[eluser]markup2go[/eluser]
Hi and welcome to CI! After your validation has passed you will want to insert the posted data into the session. I didn't see that going on in your example code. Have a read here: http://ellislab.com/codeigniter/user-gui...sions.html because in order to grab session data you have to put it there first!
[eluser]bubaphex[/eluser]
Hey man, thanks for the reply. Should i be just addeding in $this->session->userdata('formdata'); to my page2 method ?
[eluser]markup2go[/eluser]
[quote author="bubaphex" date="1256615978"]Hey man, thanks for the reply. Should i be just addeding in $this->session->userdata('formdata'); to my page2 method ?[/quote] If you plan on doing something with the data from page 1 then yes. If not, just leave it in the session until you are ready to do something with it.
[eluser]bubaphex[/eluser]
ahh so i should put it in the model then? Quote:<?php I've tried it this way doesnt seam to work for me
[eluser]bigtony[/eluser]
[quote author="bubaphex" date="1256615978"] Should i be just addeding in $this->session->userdata('formdata'); to my page2 method ? [/quote] Note that $this->session->userdata just READS the value in the session variable. To store it, you need to use $this->session->set_userdata('formdata', $yourformdata);.
[eluser]mjsilva[/eluser]
You might want to check this Jquery plugin: http://www.jankoatwarpspeed.com/post/200...query.aspx |
Welcome Guest, Not a member yet? Register Sign In |