Still can't get how to pass in a...

User 2159832 Photo


Registered User
55 posts

I have read all the posts in this forum and can't get any of the examples to fit my situation. Most of the posts are dealing with either MySQL or passing values from one form to another form etc.

My situation is simply opening a web page containing an embedded 'Web Form Builder' form and display a value that was passed in by the URL in a form text field .

A more detailed background is I launch a web page with an embedded Web Form Builder form from a desktop application using the ShellExecute API and calling for example "http://www.mysite.com/checkthis.php?lic=123".

My contact page is saved with a .php extension instead of .html.

I edited mywebform.html created by WFB to add "value="<? echo $_GET['lic'] ?>" to the form element.

All I get is "value="<? echo $_GET['lic'] ?>" showing on the text field instead of "123".

I think I understand that the value is not preserved by the embedded form when it is displayed but what is the solution?
User 122279 Photo


Senior Advisor
14,461 posts

Is your WebFormBuilder form embedded in an iframe?

If so, you will have to include the variable in the source file too.

I have an example of a passed variable here:
<div class="form">
<iframe height="892" style="border:none; background:transparent; overflow:hidden; width:100%;"
id="fb_iframe" src="path/to/form.html?property=<?php echo $_GET['property']; ?>">
</iframe>
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 10077 Photo


Senior Advisor
1,095 posts

In addition to having the variable in the iframe source, here are some other considerations.

The link you gave is checkthis.php?lic=123
Is that the actual form generated by WFB or does that page contain the script generated by WFB? You have to link directly to the form if you want php to execute within the form code.

Make sure your server is running the correct version of PHP.

Maurice Dykes wrote:
I edited mywebform.html created by WFB to add "value="<? echo $_GET['lic'] ?>" to the form element. All I get is "value="<? echo $_GET['lic'] ?>" showing on the text field instead of "123".

If you added <? echo $_GET['lic'] ?> to the value of the form element, here are a two things to check.

You need a semicolon after your php statement. <?php echo $_GET['lic']; ?>

Did you add the php statement inside WFB? If so, when you export the form, it changes the < and > to their ascii counterparts. You have to go back into the form and manually change them back to < and >.
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 2159832 Photo


Registered User
55 posts

Thanks Inger for the reply..

I tried it and still no luck. It still displays "value="<? echo $_GET['lic'] ?>" in the text field on my form.

More background...
checkthis.php is a page on my website that contains my website template.
It contains a couple of lines that were produced by WFB in the manual Export instructions - in other words I'm using an embedded form.

Freeup.html is the name of the form produced by WFB.

I noticed the embedded WFB code produced by WFB contains a JS and a noscript iFrame so I use the noscript iFrame only and also deleted the noscript tags therefore leaving this line only...

<iframe width="650" height="524" style="border:none; background:transparent; overflow:hidden;" id="fb_iframe" src="freeup/freeup.html?lic=<?php echo $_GET['lic']; ?>"></iframe>

I changed "property' to 'lic" to reflect my variable name and naturally the path is different than your example.

Freeup.html contains "value="<?php echo $_GET['lic'] ?>" in the text field.

I just noticed there is a reply from Brian as well in this thread so I am now going to digest what he wrote.
User 187934 Photo


Senior Advisor
20,193 posts

Can we have a link to the form?
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 2159832 Photo


Registered User
55 posts

Brian Durfee wrote:
The link you gave is checkthis.php?lic=123
Is that the actual form generated by WFB or does that page contain the script generated by WFB?

That is page on my site that hosts the embedded form so I have my website template surrounding the form.

Brian Durfee wrote:
You have to link directly to the form if you want php to execute within the form code.

Are you saying I can't used an embedded form?

Brian Durfee wrote:
Make sure your server is running the correct version of PHP.

5.3.28

Brian Durfee wrote:
You need a semicolon after your php statement. <?php echo $_GET['lic']; ?>

Fixed

Brian Durfee wrote:

Did you add the php statement inside WFB? If so, when you export the form, it changes the < and > to their ascii counterparts. You have to go back into the form and manually change them back to < and >.

Not sure what you mean. I added the Value= code to the form manually.
User 2159832 Photo


Registered User
55 posts

Eric Rohloff wrote:
Can we have a link to the form?


I would rather not post a link to my website since this form is integral to a user getting links to upgrading pricing or even a free license. The form is only reachable by users of my app that are registered with an older license and the app uses the ShellExecute API to call my URL. There will be no links on my site to the form or it's container page. In other words, I do not want this conversation Google(able) by users of my app.

Can I use S-drive to also host a dummy form along with the WFB stuff?
User 187934 Photo


Senior Advisor
20,193 posts

Do you have your server setup to parse php inside a html page?
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 2159832 Photo


Registered User
55 posts

Eric Rohloff wrote:
Do you have your server setup to parse php inside a html page?

Yes it must be enabled because I use php scripts within html to show local time to a visitor.
User 187934 Photo


Senior Advisor
20,193 posts

Do you still have the iframe code wrapped in the script as its generated by form builder?
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

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.