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 code in template problem after updating from 2.2.2 to 2.5.3

November 19, 2012 2:37pm

Subscribe [1]
  • #1 / Nov 19, 2012 2:37pm

    dliu

    18 posts

    Hi,

    We are upgrading ee version from 2.2.2 to 2.5.3. We got problem after updating. We insert php code in the template and set PHP parsed at “input” stage. Everything worked fine in 2.2.2. It was showed as: https://listings.jobs.vt.edu/applicants/Central?quickFind=194680

    However it does not work in the 2.5.3. It is showed as: https://listings.jobs.vt.edu/applicants/Central?quickFind=194680
    in the ee 2.5.3 version

    Following is my code

    <?php
    
    $spcial_caractor = array("", "");
                                                                                                                                                    $link = str_replace($spcial_caractor, "", '{how_to_apply}')        
    
    echo        " <a ><br><br><strong>{title}</strong></a><br>";        
    ?>

                                                                                             
         
    Can anyone can help?     


    Thanks,

  • #2 / Nov 19, 2012 3:10pm

    MadWebDesigns

    147 posts

    Did you try changing your template php parsing stage to “output”?

    Also, try to add a “;” at the end of your second line for the str_replace(...) code.

    Mike

  • #3 / Nov 19, 2012 3:41pm

    dliu

    18 posts

    Hi Mike,

    I changed php parsing stage to “output” and added a “;” at the end of str_replace(...) code.


    My code is as following:

    <?php
    $spcial_caractor = array("", "");
    $link = str_replace($spcial_caractor, "", '{how_to_apply}');
    echo "<a ><br><br><strong>{title}</strong></a><br>";
    ?>

    The error is showed in the page.

    Parse error: syntax error, unexpected T_STRING in /htdocs/no-ssl/system/expressionengine/libraries/Functions.php(680) : eval()‘d code on line 156

     

     

     

  • #4 / Nov 19, 2012 5:02pm

    MadWebDesigns

    147 posts

    Change the parsing stage to “input” and try that. If it doesn’t work, can you post the rest of your code so we can have a look please.

    Mike

  • #5 / Nov 20, 2012 1:00pm

    dliu

    18 posts

    Hi Mike,

    I created a new template, used same code as it was before in the template and changed the parsing stage to “output”.  No error message anymore. Now it works.

    Thanks,

  • #6 / Nov 20, 2012 1:24pm

    MadWebDesigns

    147 posts

    It sounds like you had a caching issue. But I’m glad you got it working 😊

    Cheers,

    Mike

  • #7 / Nov 21, 2012 12:11pm

    Dan Decker

    7338 posts

    Hi dliu,

    I agree with Mike, looks like a caching problem after the update.

    Is there anything else I can assist you with?

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

ExpressionEngine News!

#eecms, #events, #releases