I know it is not possible for an html form to have two actions, but maybe there is a better way for me to accomplish what I need. I have a simple form that collects the users email address and signs them up for a Constant Contact email list. In addition, the email is submitted to another controller which displays a thank you message that contains the $email variable from the form. I can accomplish both of these things separately but cannot get them to work in sync with each other since the form information is being sent to thankyou() and the Constant Contact site. I'm sure there is a way for me to send this data to Constant Contact via the thankyou() controller, I am just not sure how to do that.
Also, I cannot use ajax with this because I need to show a different page on submit to track how many times the thank you page has been viewed.
Use flashdata, and store the email address in a flashdata variable.
$this->session->set_flashdata('email', $email);
Keep in mind that you will need to "keep" the flashdata if it is not used in the next request, otherwise it will disappear.
$this->session->keep_flashdata('email');
Then, set the $email
variable for the view to $this->session->flashdata('email');