Passing PHP values - Post ID 254956

User 2809092 Photo


Registered User
6 posts

Hi,
I need to pass php value into hidden field of WFB form, however it doesn't work at all (passing value within index.php works like a charm). Please find out all information below:

1. Prefix of index.php
<?php
require_once("/var/www/html/bast3k/slpw/slloginform.php");
$groupswithaccess="PUBLIC";
$loginpage=$slpagename;
$logoutpage=$slpagename;
$loginredirect=0;
require_once("/var/www/html/bast3k/slpw/sitelokpw.php");
?>

2. Rest of index.php

<?php if (!$slpublicaccess) { ?>Welcome <b><?php echo $slusername; ?></b> .
<?php } ?> - it works like a charm

and here the form is embedded
<script type="text/javascript">document.write(unescape("%3Ciframe id=\"fb_iframe\" src=\"loty.php" + window.location.search + "\" width=\"600\" height=\"932\"allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\"%3E&lt;a href=\"loty.php\" title=\"loty\"&gt;Check out my CoffeeCup Form&lt;/a&gt;%3C/iframe%3E"));</script>
<noscript>
<iframe width="600" height="932" style="border:none; background:transparent; overflow:hidden;"
id="fb_iframe" src="loty/loty.html">
&lt;a href="loty.php" title="loty"&gt;Check out my CoffeeCup Form&lt;/a&gt;
</iframe>
</noscript>

3. changed ascii codes in form.html (during manual export, WFB changes <? and ?> into ASCII, that's why it needs to be changed
<input type="hidden" name="email" value="<?php echo $slusername; ?>;"

What to do else to pass php variables into form?

Thanks in advance for your help here.
Cheers,
User 187934 Photo


Senior Advisor
20,271 posts

Remove the script surrounding the form iframe code.
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 2809092 Photo


Registered User
6 posts

Hi, still doesn't work. I left following code:

<iframe width="600" height="932" style="border:none; background:transparent; overflow:hidden;"
id="fb_iframe" src="loty/loty.html">
&lt;a href="loty.php" title="loty"&gt;Check out my CoffeeCup Form&lt;/a&gt;
</iframe>

maybe *.html is not parsing php?
User 2809092 Photo


Registered User
6 posts

I've made following change in /etc/httpd/conf.d/php.conf:

<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php
</FilesMatch>

now, I can execute php code within .html file, however <?php echo $slusername; ?> value is still empty. What should I try next?
User 2809092 Photo


Registered User
6 posts

I added php require_once function into .html and it works like a charm.
cheers
User 187934 Photo


Senior Advisor
20,271 posts

sebastian.szumczyk wrote:
I added php require_once function into .html and it works like a charm.
cheers

Where did you add this?
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.