Writing and reading session variables
Writing and reading session variables
Hello
I have created a form for my user to complete and I've set the Copy Session values in fields to on. I can't find anywhere what the variables are called or how I might be able to retrieve them. The form processor says read the manual which I have. I've also checked the forum but can't find anything that helps.
I want to use the price variable in a bit of JS from stripe to enter a payment value.
This is the form which I want to submit http://www.proc2w.co.uk/instantproc2w.php Once submitted it goes to the payments page which will have the stripe JS.
Any help greatly appreciated.
Rob
I have created a form for my user to complete and I've set the Copy Session values in fields to on. I can't find anywhere what the variables are called or how I might be able to retrieve them. The form processor says read the manual which I have. I've also checked the forum but can't find anything that helps.
I want to use the price variable in a bit of JS from stripe to enter a payment value.
This is the form which I want to submit http://www.proc2w.co.uk/instantproc2w.php Once submitted it goes to the payments page which will have the stripe JS.
Any help greatly appreciated.
Rob
Re: Writing and reading session variables
To which part of the Web Builder is this question related?
Re: Writing and reading session variables
To the DBTS form Processor.
The text says Copy Field values in session (Multipage Form)
This will copy all the variables sent through the form, in a session array which will allow you to pass these values over to another page or script. Please look at the manual.
The manual isn't helpful. I need to be able to populate a field in some js from stripe with this variable.
The text says Copy Field values in session (Multipage Form)
This will copy all the variables sent through the form, in a session array which will allow you to pass these values over to another page or script. Please look at the manual.
The manual isn't helpful. I need to be able to populate a field in some js from stripe with this variable.
Re: Writing and reading session variables
I'm sorry I think only George (the creator of the DBTS form processor) can assist you with this.
- Navaldesign
-
- Posts: 1169
- Joined: Sat Mar 01, 2008 8:08 pm
- Location: Italy
- Contact:
Re: Writing and reading session variables
From the very first page of the manual:
The DBTS Preview is a completely customizable extension that works with the
DBTS Form Processor Extension. It will allow you to create Preview Pages and
Data Merge Confirmation Pages simply dragging the Preview Object in your pages.
So it is obvious that you should read the related section. From the manual:
Creating a Success Page that contains the submitted data (data merge):
As we have already seen, if you want your visitor’s submitted info formatted
in a table, you can simply use the DBTS Preview Object. Further info is
available with the manual of that extension. However, sometimes, you might
prefer a free layout that will contain the submitted info.
.... goes on with instructions.......
which is exactly what you are asking for: making the form values available in your page so you can use them, either in a free layout (in example, a salutation: Hello George where George is the value passed through the form "Name" field" or simply to make the value available in order to pass it over to a PHP script or a Javascript .
Please read the DBTS Preview object manual for further info and to understand the settings you must use. Here is a small summary:
Add the DBTS Preview object in your page where the Javascript script is. Set it NOT to display the automatically created visual output. This way the Preview extension will "read" the variables passed through the form (in the initial page) and will make them available as PHP variables.
In example, the form field "Name" will generate (automatically) a variable $Name.
To pass this as value to your Javascript, type <?php echo $Name;?> inside your Javascript code, in place of the value.
The DBTS Preview is a completely customizable extension that works with the
DBTS Form Processor Extension. It will allow you to create Preview Pages and
Data Merge Confirmation Pages simply dragging the Preview Object in your pages.
So it is obvious that you should read the related section. From the manual:
Creating a Success Page that contains the submitted data (data merge):
As we have already seen, if you want your visitor’s submitted info formatted
in a table, you can simply use the DBTS Preview Object. Further info is
available with the manual of that extension. However, sometimes, you might
prefer a free layout that will contain the submitted info.
.... goes on with instructions.......
which is exactly what you are asking for: making the form values available in your page so you can use them, either in a free layout (in example, a salutation: Hello George where George is the value passed through the form "Name" field" or simply to make the value available in order to pass it over to a PHP script or a Javascript .
Please read the DBTS Preview object manual for further info and to understand the settings you must use. Here is a small summary:
Add the DBTS Preview object in your page where the Javascript script is. Set it NOT to display the automatically created visual output. This way the Preview extension will "read" the variables passed through the form (in the initial page) and will make them available as PHP variables.
In example, the form field "Name" will generate (automatically) a variable $Name.
To pass this as value to your Javascript, type <?php echo $Name;?> inside your Javascript code, in place of the value.
www.dbtechnosystems.com
Re: Writing and reading session variables
Thanks for the help. I had worked out the Preview bit and used it on the success page. I just can't get the JS to recognise the variable.
I'll get in touch with Stripe support.
I'll get in touch with Stripe support.
- Navaldesign
-
- Posts: 1169
- Joined: Sat Mar 01, 2008 8:08 pm
- Location: Italy
- Contact:
Re: Writing and reading session variables
Please paste here the line of your Javascript where the variable value must be placed.
www.dbtechnosystems.com
Re: Writing and reading session variables
Hi George
Thanks for your help. This is the line.
data-amount= <?php echo $EquipmentPrice;?>
I've tried all sorts of permutations. I don't for a minute think it's a problem with WB11. The real problem is probably with my lack of knowledge.
Anyway thanks for looking.
Rob
Thanks for your help. This is the line.
data-amount= <?php echo $EquipmentPrice;?>
I've tried all sorts of permutations. I don't for a minute think it's a problem with WB11. The real problem is probably with my lack of knowledge.
Anyway thanks for looking.
Rob
Re: Writing and reading session variables
your variable seem to not be ok usually we do not use '-' in a variable:
data-amount
lesproductions MB http://lesproductionsmb.com
- Navaldesign
-
- Posts: 1169
- Joined: Sat Mar 01, 2008 8:08 pm
- Location: Italy
- Contact:
Re: Writing and reading session variables
But, is this the complete line of your Javascript ?
Also, where is your Javascript placed in the page code ? It should be AFTER the DBTS Preview object, otherwise you are calling the variable $EquipmentPrice BEFORE the DBTS Preview has retrieved it from the session variables, so it is not yet available.
Add a HTML box in your page.
Add the following code in it:
<?php
print_r($PREVIEW);
?>
This will display, in your page, the array (keys and values) that are passed in the page, so you will be able to see exactly what the variable is. Some times it is simply an uppercase first letter. Make sure to NOT clear the session values (at least temporarily, for testing purposes).
After you have fixed it and you know what you need to do, delete the HTML box.
Also, where is your Javascript placed in the page code ? It should be AFTER the DBTS Preview object, otherwise you are calling the variable $EquipmentPrice BEFORE the DBTS Preview has retrieved it from the session variables, so it is not yet available.
Add a HTML box in your page.
Add the following code in it:
<?php
print_r($PREVIEW);
?>
This will display, in your page, the array (keys and values) that are passed in the page, so you will be able to see exactly what the variable is. Some times it is simply an uppercase first letter. Make sure to NOT clear the session values (at least temporarily, for testing purposes).
After you have fixed it and you know what you need to do, delete the HTML box.
www.dbtechnosystems.com
Re: Writing and reading session variables
Hi Naval
Thanks for your help. I've decided I need professional help. As good as WB is it can't compensate for my lack of programming skills.
Thank you very much for your time and effort!
Thanks for your help. I've decided I need professional help. As good as WB is it can't compensate for my lack of programming skills.
Thank you very much for your time and effort!
Who is online
Users browsing this forum: No registered users and 1 guest