tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/226-php-formsCascade CMS: Discussion 2018-10-18T20:36:36Ztag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T14:07:04Z2012-08-03T14:07:04ZPHP Forms<div><p>Hi tmhenson,</p>
<p>Let's try using the <strong>$_EscapeTool</strong> and see if
that helps:</p>
<pre>
<code>elseif ($_GET['submitted'] == 'true') { //NO POST, FORM submitted SHOW confirmation
print("${_EscapeTool.html($callingPageData.getChild('system-data-structure').getChild('confirmation_text').value)}");
}</code>
</pre>
<p>Note: using <code>$_EscapeTool.html()</code> should already
convert the HTML to entities so I removed the
<code>htmlentities()</code> call in your print statement.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T14:31:39Z2012-08-03T14:31:39ZPHP Forms<div><p>The text shows up now but it is stripping the HTML tags from the
WYSIWYG now.</p></div>tmhensontag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T14:37:06Z2012-08-03T14:37:06ZPHP Forms<div><p>Hm, let's try the <strong>$_SerializerTool</strong> instead:</p>
<pre>
<code>elseif ($_GET['submitted'] == 'true') { //NO POST, FORM submitted SHOW confirmation
print("${_SerializerTool.serialize($callingPageData.getChild('system-data-structure').getChild('confirmation_text'), true)}");
}</code>
</pre></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T15:20:35Z2012-08-03T15:20:35ZPHP Forms<div><p>The tags are rendered but it creates an error and the page will
not load.<br>
I tried</p>
<pre>
<code>print(htmlentities("$callingPageData.getChild('system-data-structure').getChild('confirmation_text').value"));</code>
</pre>
<p>which sends the WYSIWYG as text not HTML either.</p></div>tmhensontag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T15:31:30Z2012-08-03T15:31:30ZPHP Forms<div><p>Typically WYSIWYG content is outputted with the SerializerTool,
I believe just using value would strip the HTML out.</p>
<p>What was the error message you received with my <a href=
"http://help.hannonhill.com/discussions/velocity-formats/226-php-forms#comment_17804439">
previous suggestion</a>?</p>
<p>Maybe you could try outputting the HTML to the page and not
converting it to a String in PHP (not sure if this will break
anything though):</p>
<pre>
<code>elseif ($_GET['submitted'] == 'true') { //NO POST, FORM submitted SHOW confirmation
?>${_SerializerTool.serialize($callingPageData.getChild('system-data-structure').getChild('confirmation_text'), true)}<?php
}</code>
</pre></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T15:49:52Z2012-08-03T15:49:52ZPHP Forms<div><pre>
<code>print('${_SerializerTool.serialize($callingPageData.getChild('system-data-structure').getChild('confirmation_text'), true)}');</code>
</pre>
<p>I change the " to ' and it is pulling the HTML in but my links
are not working</p>
<p>This is what is the source code</p>
<pre>
<code> <?php }
}
elseif ($_GET['submitted'] == 'true') { //NO POST, FORM submitted SHOW confirmation
print('<p>Thank you!!</p>
<p>For your submission!!</p>
<p><a href="site://UNA Public/web/docs/l-number.pdf">testing links</a></p>');
}
else{
?></code>
</pre></div>tmhensontag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T17:52:48Z2012-08-03T17:52:48ZPHP Forms<div><p>Hm, would you be able to paste your entire Format so I can have
a look?</p>
<p>For the quote escaping, you might be able to use:</p>
<pre>
<code>elseif ($_GET['submitted'] == 'true') { //NO POST, FORM submitted SHOW confirmation
print("${_EscapeTool.java($callingPageData.getChild('system-data-structure').getChild('confirmation_text').value)}");
}</code>
</pre>
<p>The <strong>$_EscapeTool.java()</strong> method will escape your
double-quotes and leave the single quotes alone.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T18:06:10Z2012-08-03T18:06:10ZPHP Forms<div><p>Can you try the following and see if the links are
rewritten:</p>
<p>Replace:</p>
<pre>
<code>print('${_SerializerTool.serialize($callingPageData.getChild('system-data-structure').getChild('confirmation_text'), true)}');</code>
</pre>
<p>With:</p>
<pre>
<code>?>${_SerializerTool.serialize($callingPageData.getChild('system-data-structure').getChild('confirmation_text'), true)}<?php</code>
</pre>
<p>This will essentially do the same thing as the
<code>print('WYSIWYG CONTENT);</code></p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/178034302012-08-03T18:41:45Z2012-08-03T18:41:45ZPHP Forms<div><p>That works thanks for the help.</p></div>tmhenson