How do i save variable with codeigniter through pages on a form, on the first page i receive all the variables that i need on the form, i want to save those variable to postData, an be able to access them on everypage in my form?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In most cases, the simplest approach would be to leverage Sessions. For example, to assign your “global” var using sessions in php:
session_start();$_SESSION["var_name"] = $temp_var;Please note:
session_start();must be included on each page when referencing any session variables.** Note: If you do go the route of hidden form input fields, all users will be able to view the value of the variable. In addition, you must assign the hidden input fields through out each step of the various pages that deal with the user form.