PHP in content

webteam's Avatar

webteam

07 Jun, 2012 06:24 PM

I am attempting to include PHP in the content area of a site in Cascade, and the <!--#START-CODE #END-CODE--> tags work normally for php, but I am running into an exception with code such as below. How would you recommend for this to be inserted onto a site in the html content region. (this is just part of the code, but is the area that is giving me issues)

<input id="LN" name="LN" value="<?=getFormData("search_LN")?>" type="hidden" />

Thank you,
Michele

  1. 2 Posted by Eric L. Epps on 11 Jun, 2012 01:03 PM

    Eric L. Epps's Avatar

    I usually use PHP to echo the whole tag, Cascade tends to not like the < > symbols in an attribute. Something like:

    <?php echo '<input id="LN" name="LN" value="'.getFormData("search_LN").'" type="hidden" />'; ?>
    
  2. Support Staff 3 Posted by Ryan Griffith on 11 Jun, 2012 09:18 PM

    Ryan Griffith's Avatar

    Michele,

    As Eric mentioned, inserting the <!--#START-CODE #END-CODE--> comments within the value attribute of the input tag would cause the comment (and PHP code) to become the actual value of the input.

    With either method of echo'ing, try surrounding the entire input (or PHP code) with the comments.

  3. Support Staff 4 Posted by Ryan Griffith on 18 Jun, 2012 05:20 PM

    Ryan Griffith's Avatar

    Hi Michele, Just wanted to follow up to see if you were able to get your PHP to work as expected.

    Thanks.

  4. 5 Posted by webteam on 18 Jun, 2012 05:40 PM

    webteam's Avatar

    Yes, I did - thank you for following up with me on this! It is greatly appreciated.

  5. Support Staff 6 Posted by Ryan Griffith on 18 Jun, 2012 05:41 PM

    Ryan Griffith's Avatar

    Great, I am glad to see you got this working. I am going to go ahead and close this discussion.

    If you encounter any issues relating to this, feel free to reply to re-open the discussion.

    Thanks.

  6. Ryan Griffith closed this discussion on 18 Jun, 2012 05:41 PM.

Comments are currently closed for this discussion. You can start a new one.