Announcement

Collapse
No announcement yet.

Including php files into my design

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Including php files into my design

    I have a php header and footer that I want to add into my design, which are required to tie in with existing external pages. These files reside outside the acatalog folder.

    Firstly is it possible to include these?

    If so can it be done this way?

    <actinic:block php="true">
    include_once '../includes/header.php';
    include_once '../incudes/footer.php';
    // my php code here
    </actinic:block>

    Or will it only work this way.. combine them in a file.. and place the new file in the site1 folder

    <actinic:block php="true">
    include_once 'myphpcode.php';

    // my php code here
    </actinic:block>


    Sorry for all the questions, but wanted to be armed with the correct info before I start.

    #2
    I don't know enough about PHP to answer this but if I were looking at doing it I'd take a snapshot; put the site into test mode; make a change; upload and test. If it works - great. If not, restore (or undo the changes) and try the other method (always remembering to switch back to production mode )

    Thought i'd stick that in as you hadn't had a reply yet.... may save you some time.
    Elysium:Online - Official Accredited SellerDeck Partner
    SellerDeck Design, Build, Hosting & Promotion
    Based in rural Northants

    Comment


      #3
      He hasn't started yet Goz, he's asking all questions before he starts. Once started, he can then ask them again when he loses the threads or gets stuck. Only kidding Gordon.

      If you search on 'php include' i'd expect an answer to come up, i seem to recall Jo was given a solution by Norman in the forum a few months back, which may do what you want.

      Comment


        #4
        Hi,

        I've asked about similar things to this before.

        The way to do it is build separate PHP pages and then use javascript includes to get the content on your page.

        I think this has something to do with Actinic processing all your php at upload.

        In your layout
        Code:
        <script type="text/javascript" src="yourfile.php"></script>
        In your yourfile.php file
        Code:
        document.write('<?your php code here;?>');
        I use this to write this months date on some pages. It is Norman's solution from here but hopefully it points you in the right direction
        http://www.itwiz.co.uk

        http://www.AntiV.net - The Discount Antivirus Store

        Comment


          #5
          Originally posted by mattc View Post
          Hi,

          I've asked about similar things to this before.

          The way to do it is build separate PHP pages and then use javascript includes to get the content on your page.

          I think this has something to do with Actinic processing all your php at upload.

          In your layout
          Code:
          <script type="text/javascript" src="yourfile.php"></script>
          In your yourfile.php file
          Code:
          document.write('<?your php code here;?>');
          I use this to write this months date on some pages. It is Norman's solution from here but hopefully it points you in the right direction
          Thats great mattc, I now see how to do it. Thanks for the help, will give that a go this evening

          Comment


            #6
            document.write('<?your php code here;?>');
            If your PHP is going to output single quotes, then it will need to escape them with a \. E.g.

            Plenty O'Toole would have to be Plenty O\'Toole
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X