I have eForm redirecting to a different thank you page, with its own document ID.
What’s the proper code for passing form variable values (e.g. name, email, comments, etc.) to this thank you page??
Can anyone provide specific sample code??
Thank you, Tom
Hey,
I got the same question. Suppose I want to put a link on a product page to another form. How can I pass on certain values, which are located on the product page, to the form page?
I would love to know that. Any help would be much appreciated!
Tom,
I am struggling with same issue here. Did you find any solution?
Tommy
Check out eform2db. Its not what you want but the principle is there. Instead of saving the form to database, you want to assign some $_SESSION variables that can then be loaded on which ever page you want.
-
☆ A M B ☆
- 24,524 Posts
If you want to have a link on one page that goes to another page with a form, and include some values from the first page, you can add them as key=values to the URL query string, then collect them with a snippet on the second page using the GET array. Just keep in mind that if you’re using Friendly URLs the first one has to begin with a ?, while if you aren’t using Friendly URLs your first key=value pair has to begin with a & (the index.php?a=42 already uses the leading ?).
I prefer to actually make that link on the first page a mini-form, with as many hidden fields as you need, and a submit button (styled to look like a link if you prefer). Then I use a snippet to collect the POST values and do whatever I need to with them.
The only problem with loading these values into the SESSION is if the user sits on the first page long enough for his session to time out; in which case the values are lost. Cookies are one way of avoiding that loss; storing the values in a json or other encoded string for retrieval later. Again, a snippet is needed to retrieve the string from the COOKIE and process it.