php not enabled on generated HTML form

User 2621589 Photo


Registered User
3 posts

Hi all,

Apologies in advance if I'm making newbie mistakes; I am new to WFB. :-)

I've manually modified a generated form to incorporate default values in form fields based on information pulled from a database. Specifically, I made some of the input fields "hidden" instead of "text" and I load their values from the database. To do this, I modified the generated .html and added a <?php ... ?> section to do the database access and generate the values.

If I load the generated/modified .html file in my browser, it works perfectly. But if I load the generated (unmodified) .php file, the embedded PHP section that I added is not enabled.

I have a .htaccess file in the root directory (otherwise, the .html file wouldn't work, either). It contains this:
AddType application/x-httpd-php .html .htm
AddHandler application/x-httpd-php .html .htm

I've obviously missed something, though, since PHP isn't enabled when the generated/modified HTML file is loaded via the generated PHP file. Can someone help, please? Also, is there a better way to include hidden fields with values loaded from a database via PHP than manually editing the generated HTML?

Thanks SO much in advance for any help!
User 187934 Photo


Senior Advisor
20,271 posts

Try removing the script that surrounds the 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 2621589 Photo


Registered User
3 posts

Eric, I really appreciate your response! Where is the <script>/<iform> to which you're referring? At present, I'm just navigating directly to the generated .HTML and .PHP files, not including them on a page.
User 2621589 Photo


Registered User
3 posts

I just got a bit of help from my ISP:

The issue is most likely with your class that is handling the object for the page. From what I can gather based on the myForm.php what it appears the code is doing is loading myForm.html file into an object and then flushing that object out to the page. When PHP loads a file into an object it does not parse the text found, it simply fills the object. It does not look like it goes through that object to parse any php code within that object at a later point. As far as PHP is concerned that object is just text. When you send it out to the browser it gets sent out as text causing your variables to appear.

How would I "notify" WFB that I have PHP code so that the processor that's reading myForm.html will behave appropriately? I tried putting the PHP code into an HTML object on the form, but it doesn't appear to have made any difference that I can tell (and the HTML object mangles the PHP code pretty badly to boot).

Thanks again!
User 187934 Photo


Senior Advisor
20,271 posts

I replace the myformname.php with my own custom one and use sessions if I need enhanced feed back to the user.
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.