fmpros Posted September 24, 2009 Share Posted September 24, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/ Share on other sites More sharing options...
fmpros Posted September 25, 2009 Author Share Posted September 25, 2009 Alright, if this were a MySQL backend, what would the foreach statement look like? Any feedback would be greatly appreciated. Thanks, John Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/#findComment-924908 Share on other sites More sharing options...
mikesta707 Posted September 25, 2009 Share Posted September 25, 2009 I'm not entirely sure what your question is? can you perhaps rephrase it or provide more detail as to what you want to happen and what is actually happening Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/#findComment-924917 Share on other sites More sharing options...
fmpros Posted September 25, 2009 Author Share Posted September 25, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/#findComment-924964 Share on other sites More sharing options...
TeNDoLLA Posted September 25, 2009 Share Posted September 25, 2009 Is this the only part that gets printed out not in html? $form_html .= $question->getField('MyField'); maybe try.. $form_html .= html_entity_decode($question->getField('MyField')); Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/#findComment-924967 Share on other sites More sharing options...
fmpros Posted September 25, 2009 Author Share Posted September 25, 2009 TeNDoLLA, thanks a million! That did the trick. I've been banging my head up against a wall for nearly 24 hours now! Much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/175424-html-output-from-a-fieldcolumn-value-syntax-help/#findComment-924973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.