ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP in entries?

March 08, 2012 7:47pm

Subscribe [3]
  • #1 / Mar 08, 2012 7:47pm

    blackberg

    12 posts

    is there a way to have some php in an entry?
    or am I stuck importing an iframe?

    thanks
    -bb

  • #2 / Mar 09, 2012 11:02am

    LMO

    203 posts

    blackberg,

    Go to the template manager and select the template you want to use the PHP in and turn php on within the template preferences.

  • #3 / Mar 09, 2012 12:54pm

    blackberg

    12 posts

    I have done that, but text imputed into the entry tab using a PHP enabled template, will type out the text and not proccess the php

    -bb

  • #4 / Mar 09, 2012 12:59pm

    LMO

    203 posts

    You will need to describe what you are trying to do in more detail. Also posting some example code of what you are doing will help.

  • #5 / Mar 09, 2012 1:08pm

    Shane Eckert

    7174 posts

    Hello blackberg,

    Thank you for posting your question.

    Make sure that you have output or input selected as needed.

    Having a peek at your code would be helpful.

    Cheers,

  • #6 / Mar 09, 2012 2:46pm

    blackberg

    12 posts

    I have a web page using a template, the template has php enabled
    in the entry that the page uses, the body field, I want to type some php code in that will display on the webpage.

    if I type

    <?php echo 'Hello World'; ?>

    in the entry field,

    it will display this in the source code of the page when it loads

     <?php echo ‘
    Hello World
    ‘; ?> 

    If use the php in the template itself it works, but this is a one off thing, that may be used in the future but not now, but I will have to create a new template and channel to use the way we need to use it.  Something completely different came up the other day, and that would required a completely different template and completely different channel to get it to work, I handled that one in an iframe, and it was fine for that. 

    If I can get the “hello world” to work, then my code should work

    I already tried changing the output and input
    changing the none/xhtml/< br/ >

    and it wont work

    -bb

     

  • #7 / Mar 09, 2012 2:50pm

    LMO

    203 posts

    For security reasons PHP will never work inside content fields. I misunderstood your first post.

  • #8 / Mar 09, 2012 8:05pm

    Sean C. Smith

    3818 posts

    Hi blackberg,

    VIM Interactive is correct. This is a security precaution. Is there anything else I can assist you with?

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases