1 Reply Latest reply on May 19, 2010 8:49 AM by Randy Edmunds

    How do i include PHP within a library item

    hame21

      Hi

       

      Trying to include some PHP within a library item. PHP works outside of item but does not render within.

       

      Obviously doing something wrong, could someone point me in the right direction.

       

      My library item code is:

       

      <div id="tabs-2">
                         <ul class="csList">
                                 <li>
                                   <h3><a href="">Headline</a></h3></li>
                           <li><h3><a href="" target="_blank">Headline 2</a></h3></li>
                           <?php
                           require_once(dirname(__FILE__).'/includes/inc.functions.php');
                           echo "hello";
                           aspicList(2);
                           ?>
                          
                           </ul>              </div>

       

      thanks in advance

        • 1. Re: How do i include PHP within a library item
          Randy Edmunds Adobe Employee

          Trying to include some PHP within a library item. PHP works outside of item but does not render within.

           

          My library item code is:

           

          <div id="tabs-2">
                             <ul class="csList">
                                     <li>
                                       <h3><a href="">Headline</a></h3></li>
                               <li><h3><a href="" target="_blank">Headline 2</a></h3></li>
                               <?php
                               require_once(dirname(__FILE__).'/includes/inc.functions.php');
                               echo "hello";
                               aspicList(2);
                               ?>
                              
                               </ul>              </div>

           

          Where is it working vs not working? browser? Design View? Live View? Preview in Browser?

           

          What is the contents of your include file? The only valid markup at the point of your PHP block is <li> tags. You should change your test line of code to:

           

            echo "<li>hello</li>";

           

          HTH,

          Randy