Announcement

Collapse
No announcement yet.

Random Banner Script and cgi-bin

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

    Random Banner Script and cgi-bin

    This might be a simple one, or it might also be complicated - but hopefully not impossible!

    I have a simple javascript which runs a random banner at the top of our site ( example1 ).

    In that particular example, the script is placed in the body of the act_primary template. Now this all works fine until a page goes through the cgi-bin. For example the Contact Us page uses the same template, but the banner doesn't show ( example2 ).

    Anyone understand why this might happen?

    I tried copying images into the cgi-bin, changing the scripts links to the banner images and simple stuff like that but with no joy.

    Any assistance, much appreciated in advance.

    Graham

    #2
    Your script must use relative paths - change those to absolute (ie, include the leading / or even the full URL (http://....) and they should begin working again.
    Web Design & Ecommerce - Affordable Web Hosting
    Free and low cost Merchant Accounts coming soon..
    NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

    Comment


      #3
      myimages[1]="banner_biolage_01.gif"
      myimages[2]="banner_ghd_andthereshewas.gif"
      myimages[3]="banner_ghd_more.gif"
      myimages[4]="banner_nioxin_empower.gif"
      myimages[5]="banner_redken01.gif"
      myimages[6]="banner_redken_smoothdown.gif"
      myimages[7]="banner_t3_01.gif"

      = relative paths... change to absolute or full URLs
      Web Design & Ecommerce - Affordable Web Hosting
      Free and low cost Merchant Accounts coming soon..
      NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

      Comment


        #4
        Thanks for looking at this, but I'd already tried this without success (I have now added absolute url's to the act_primary template, just in case).

        When I view the source code for a successful page and an unsuccessful one, the only difference I can see is that the cgi-bin page produces a line in the scripts source code as follows...

        document.write('<A HREF='http://www.venus365.co.uk/acatalog/+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')

        Where as, the successful page sticks with the original script code...

        document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')

        ie. the unsuccessful page changes the script to add in a path after the href=

        Unfortunately as I know zilch about code & cgi-bins, I don't know what this means, or the cure

        Comment


          #5
          Either way you have an unescaped string after the acatalog. Also you cannot mix " with ' - you must enclose any strings in one or the other.

          Change it to:

          document.write('<a href="http://www.venus365.co.uk/acatalog/"' + imagelinks[ry] + '"><img src="' + myimages[ry] + '" border="0"></a>');

          This encloses all strings inside of complete ' quotes, allowing you to use " in the normal way.

          Image refs should also be absolute as previously discussed.
          http://www.johnsons-seeds.com - Actinic plugins, remote add to cart and custom CMS
          http://www.dtbrownseeds.co.uk - More seeds and plants....
          http://www.mr-fothergills.co.uk - Well it used to be Actinic...

          Comment


            #6
            Geniuses - thank you

            The banner rotator now works on all my cgi-bin pages as well.

            Sincere thanks for your help.

            Comment

            Working...
            X