Passing Variables through the URL -...

User 436634 Photo


Registered User
3 posts

Looking for assistance in passing variables through the URL using the hidden fields option.

The variables I am looking to pass are:
<exam_id>
<refid>
<refname>

Here is a sample of the URL:
http://www.theurl.com/hrgs/refersurvey? … LMAN,%20MD

Please advise on Name and Value that needs to be set up. Thanks.
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

Pass them on the comfirm option by using the Redirect to another URL.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

Here's an example.;)
http://progrower.coffeecup.com/forms/passurlvariables2/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 436634 Photo


Registered User
3 posts

Im sorry. Im not sure if i was clear. I need the variables to be placed in to the form from an incoming URL.
User 10077 Photo


Senior Advisor
1,095 posts

I've worked through exactly what you are asking and am currently using it at http://candle-fundraising.org/. Here is what worked best for me.

1. Create a php page on your web site that will contain all your variable instructions. (More about this later. Just create the page.) For this example, I'll use formstuff.php

2. At the top of your form, place an HTML element and set the margins to 0 all the way around. For the element content, enter:
<?php include('formstuff.php'); ?>


3. In formstuff.php, enter all the code to covert the passed variables to variables you use on your page. For example, if you passed: pagename.php?i=foo&t=bar
then your code on the page would be:
<?php $var1 = $_GET['i']; $var2 = $_GET['b']; ?>

Make sure you add whatever security you need as far as "cleaning" the variables so no malicious code gets passed to the form.

4. In WFB, for elements that need the passed variables, enter the php code for that variable as the value for the element. For example, element1 might have a value like:
<?php echo $var1; ?>

and element2 might have the value:
<?php echo $var2; ?>


5. When you export your form, you will need to do the following to use your form:
--- A. Either set your server to run php within html or rename your form page to .php
--- B. Look at the form page. WFB converts the html brackets to ascii code. You will have to manually change them back.
&lt; should be changed to <
&gt; should be changed to >
--- C. You will have to manually use the form. That means, you either have to create your own iframe on the page to display it, or insert the form with the links to the javascripts and css on your page.

ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

If you submit my form you will also see that it's receiving the variables through the url.;)
No php so this can be used on S-Drive.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 436634 Photo


Registered User
3 posts

Brian,
Thank you for the info. It is all above my pay grade so I will have to find someone to assist me.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.