Jump to content

HTML Output from a Field/Column value. Syntax help!


Recommended Posts

I would really appreciate some insight on the correct syntax to output HTML.  I'm trying to build a form dynamically from a FileMaker database.  I believe this is a syntax issue not a FileMaker issue.

 

$form_html = '<form method="post" action="register-exe.php">';
$form_html .= '<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td colspan="3"><hr noshade="noshade" size="1" /></td></tr>';

foreach($questions as $question ) {
//the getField is a FileMaker function.  It works but the output is literal when I echo it out.
$form_html .= $question->getField('MyField');
}
$form_html .= '<tr><td colspan="2" class="epi-spacerCell"><input type="submit" name="Submit" value="Apply"></td></tr>';
$form_html .= '<tr><td colspan="3"><hr noshade="noshade" size="1" /></td></tr></tbody></table></form>';

 

 

The field value is:

<tr>
<td class="epi-formLabel"><label for="test"></label></td>
<td><input class="epi-input" size="40" name="test" id="71" type="text"  ></td>
</tr>

 

Within the body of the document, I echo the variable as so:

 

<?php echo $form_html; ?>

 

What is the correct syntax to output HTML from a field or column value?  Thanks very much!

I'm trying to create a table and form dynamically.  The field values contain html strings.  My script works except that instead of outputting a table and form, I see the actual HTML code on the page itself.  So where I would like to viewing a table, I see the actual tags. I'm certain that the line that is causing the problems is as follows:

 

$form_html .= $question->getField('MyField');

 

My question is, if this were a MySQL backend what would this line look like?  Does that make sense?  Thanks in advance!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.