Announcement

Collapse
No announcement yet.

How do I add an include

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

    How do I add an include

    I have a small pl script I want to run so that it outputs some text into my footer.
    <?php @include("http://www.mydomain.com/cgi-bin/myscript.pl"); ?>

    Do I call this as a variable in a block like <actinic:block php="true">.
    I have tried many combinations to get this to work.
    Has anyone got an example of such an include.

    Any help appreciated.
    Tony
    Your one stop shop for spares.
    Washing Machine Spare Parts

    #2
    Doesn't a line like that actually have to be on a page parsed by a php script? In which case, it might be tricky to include it on every Actinic page.

    You could always have a small iframe box at the bottom of the design that displays the results of the perl script.

    Comment


      #3
      Actually I think you can use this method providing you set a directive for Options Include in your conf file and tell apache to treat html as shtml.
      This is not a great way to do this as it wastes server resources.

      Having said that I have found a work around but only works for the page you have the script on.
      I used the following include instead.
      <!--#exec cgi="/cgi-bin/script.pl"-->
      But you need to set an executable bit on the page your trying to run the script.
      I had already looked at Iframes but didn't like the way the script remains enclosed in the tags. After all, I needed the output text to appear as part of the page, for obvious reasons ;-].
      You can see it in action at www.keepingupappliances.com
      The text below the last group of latest products is the parsed text and it changes everytime the page is refreshed. This is a great SEO trick I have used on other web sites.

      Thanks
      tony
      Your one stop shop for spares.
      Washing Machine Spare Parts

      Comment


        #4
        Do you want your script to be executed when your product pages are generated at the desktop or when it is displayed in the buyer's browser? If the latter then you can utilise a recent modification on the default Actinic js library. It was added to support include external HTML bits but I believe it will work here as well. Just try adding the following code to your layout where you would like your script output to be displayed.
        Code:
        <a rel="fragment" href="http://www.mydomain.com/cgi-bin/myscript.pl">Alternate text</a>
        The alternate text is displayed in case of old browsers which don't support the used js functions.

        I hope this helps.
        Zoltan
        Actinic Software
        www.actinic.co.uk

        Comment


          #5
          OK I have now implemented the 'rel' method you suggested and must admit it is a far better way to do it from a design point of view. Just put the script tag where you want the text to appear and thats it, no messy business at the server level.
          The only difference being it leaves a footprint of the script in the source, as the way i had implemented it, the text appears seamlessly on the page. This makes no difference to the viewer of course but is mearly a seo technique that could have implications.
          Having said that I'm sticking with your suggestion, thanks for the tip.
          Anyone that's interested can get the script free from that matt fella.

          Thanks
          Tony
          Your one stop shop for spares.
          Washing Machine Spare Parts

          Comment

          Working...
          X