11 Replies Latest reply on Oct 30, 2006 6:14 PM by Newsgroup_User

    Trouble with images and PHP

    Level 7
      I have just wasted several hours trying to run down a very tricky bug introduced
      by converting some of my files to php. I put a feedback envelope in the footer
      on my basic page template, and linked it to a separate feedback page,
      incorporating David's techniques.

      Everything worked fine on my PC, but when I uploaded index.php to the server
      there was no trace of the image, or the link. After trying various tricks the
      image appeared, and everything worked fine. But a few minutes later it had gone
      again!

      Eventually I discovered that the footer contains a red arrow on the left, with a
      link to the top of the page, and the comments image on the right. If I inserted
      additional images in between the two the first image following the red arrow did
      not appear. I then noticed that the code for most of the images on the page had
      been modified by adding a terminal /, e.g.
      <img src="Images/Blue_14r.gif" width="20" height="14" />

      I presume this must have been done when I updated the page to .php. During this
      process the document preamble was changed to "<!DOCTYPE html PUBLIC "-//W3C//DTD
      XHTML 1.0 Transitional//EN"
      " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">", and Dreamweaver must have updated
      the existing image statements. However the red arrow code had not been updated,
      and apparently this upset the server.

      I went through the page, and ensured that every image statement was properly
      terminated, and the page now appears to operate correctly. If you are
      interested, have a look at http://www.corybas.com/index.php, which incorporates
      the corrections. On the other hand http://www.corybas.com/index_a.php
      demonstrates one version of the problem. I have inserted two additional copies
      of the feedback envelope, with the second one sandwiched between inward facing
      blue triangles. For me the first blue triangle does not appear.

      The worrying part about this is that I don't know when the image statements were
      updated, but I am fairly confident that if I just change the file extensions
      they won't be changed. On the other hand if I didn't update the preambles I
      guess that I wouldn't have any trouble.

      (The feedback page is working, but so far it is only in a fairly rudimentary
      form.)


      Clancy
        • 1. Re: Trouble with images and PHP
          Level 7
          > I presume this must have been done when I updated the page to .php

          Impossible. But if this is the terminal "/" you are talking about,

          height="14" />

          it would have been caused by converting the page to XHTML, which is what the
          doctype reveals you did. XHTML requires that all tags be closed properly,
          including those that have been traditionally self-closing tags, e.g.,

          <img>, <br>, <hr>, etc. Proper XHTML syntax is <img ... />, <br/>, <hr/>
          (with or without a space before the "/>").

          > but I am fairly confident that if I just change the file extensions
          > they won't be changed.

          That's correct.

          HOWEVER, using the correct syntax or not won't cause the image not to be
          displayed, it will only cause your page to fail validation.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "Clancy" <clancy@cybec.com.au> wrote in message
          news:ho93k29ihl6uu7si6psdnh0svubushs7c7@4ax.com...
          >I have just wasted several hours trying to run down a very tricky bug
          >introduced
          > by converting some of my files to php. I put a feedback envelope in the
          > footer
          > on my basic page template, and linked it to a separate feedback page,
          > incorporating David's techniques.
          >
          > Everything worked fine on my PC, but when I uploaded index.php to the
          > server
          > there was no trace of the image, or the link. After trying various tricks
          > the
          > image appeared, and everything worked fine. But a few minutes later it
          > had gone
          > again!
          >
          > Eventually I discovered that the footer contains a red arrow on the left,
          > with a
          > link to the top of the page, and the comments image on the right. If I
          > inserted
          > additional images in between the two the first image following the red
          > arrow did
          > not appear. I then noticed that the code for most of the images on the
          > page had
          > been modified by adding a terminal /, e.g.
          > <img src="Images/Blue_14r.gif" width="20" height="14" />
          >
          > I presume this must have been done when I updated the page to .php.
          > During this
          > process the document preamble was changed to "<!DOCTYPE html PUBLIC
          > "-//W3C//DTD
          > XHTML 1.0 Transitional//EN"
          > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          > <html xmlns=" http://www.w3.org/1999/xhtml">", and Dreamweaver must have
          > updated
          > the existing image statements. However the red arrow code had not been
          > updated,
          > and apparently this upset the server.
          >
          > I went through the page, and ensured that every image statement was
          > properly
          > terminated, and the page now appears to operate correctly. If you are
          > interested, have a look at http://www.corybas.com/index.php, which
          > incorporates
          > the corrections. On the other hand http://www.corybas.com/index_a.php
          > demonstrates one version of the problem. I have inserted two additional
          > copies
          > of the feedback envelope, with the second one sandwiched between inward
          > facing
          > blue triangles. For me the first blue triangle does not appear.
          >
          > The worrying part about this is that I don't know when the image
          > statements were
          > updated, but I am fairly confident that if I just change the file
          > extensions
          > they won't be changed. On the other hand if I didn't update the preambles
          > I
          > guess that I wouldn't have any trouble.
          >
          > (The feedback page is working, but so far it is only in a fairly
          > rudimentary
          > form.)
          >
          >
          > Clancy


          • 2. Re: Trouble with images and PHP
            Level 7
            "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:

            >> I presume this must have been done when I updated the page to .php
            >
            >Impossible. But if this is the terminal "/" you are talking about,
            >
            >height="14" />
            >
            >it would have been caused by converting the page to XHTML, which is what the
            >doctype reveals you did.

            All I consciously did was to convert the file to php. But as I didn't
            understand what this involved, I went about it in an unnecessarily complicated
            way, and somewhere along the way it got converted to XHTML. This happens
            because by default Dreamweaver specifies dynamic files as XHTML, but I don't
            know what I did that caused it to update some, but not all, of the tags.

            I have no idea how it happened, and cannot replicate it, but yesterday the
            'comment' image was intermittently not displaying on the server, and after I
            corrected the image tags it is. And the missing image in my demonstration page
            was not displaying because it wasn't on the server, and presumably it was too
            small for the server to show a cross to indicate it was missing.


            Clancy
            • 3. Re: Trouble with images and PHP
              Level 7
              Clancy <clancy@cybec.com.au> wrote:

              >I have no idea how it happened, and cannot replicate it, but yesterday the
              >'comment' image was intermittently not displaying on the server, and after I
              >corrected the image tags it is. And the missing image in my demonstration page
              >was not displaying because it wasn't on the server, and presumably it was too
              >small for the server to show a cross to indicate it was missing.

              I have been fiddling with my comments page all day, and the index page has been
              behaving consistently. I was about to go to bed, and loaded the index page for
              a final check, only to discover that the 'Comments and queries' button had
              disappeared again. I modified the source code to put a few question marks in
              front of it, and the relevant line of the source code now reads:

              <td width="9%"><!-- InstanceBeginEditable name="Comment_key" --><a
              href="Feedback.php" target="_blank">???<img src="Images/Comment.jpg"
              alt="Comments and queries" width="60" height="24" border="0" /></a><!--
              InstanceEndEditable --></td>

              Again the local version of the page displays correctly, but in the remote
              version the question marks show, but the image does not. The relevant line in
              the page actually displayed reads:

              <td width="9%"><!-- InstanceBeginEditable name="Comment_key" --><a
              href="Feedback.php" target="_blank">???
              </a><!-- InstanceEndEditable --></td>

              One strange feature about this line is that the image specification has been
              replaced by a number of spaces equal to the number of characters in the original
              specification.

              So for some reason the server is intermittently converting the image source
              clause to spaces. The copyright statement on the left, which uses php, is
              displaying correctly.

              Grrrrrr!!!!!!

              Clancy
              • 4. Re: Trouble with images and PHP
                Level 7
                > This happens
                > because by default Dreamweaver specifies dynamic files as XHTML

                Only if you have selected that as the default.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.dreamweavermx-templates.com - Template Triage!
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                ==================


                "Clancy" <clancy@cybec.com.au> wrote in message
                news:bac5k2tgb274ru0asitddogmi4l19juev5@4ax.com...
                > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:
                >
                >>> I presume this must have been done when I updated the page to .php
                >>
                >>Impossible. But if this is the terminal "/" you are talking about,
                >>
                >>height="14" />
                >>
                >>it would have been caused by converting the page to XHTML, which is what
                >>the
                >>doctype reveals you did.
                >
                > All I consciously did was to convert the file to php. But as I didn't
                > understand what this involved, I went about it in an unnecessarily
                > complicated
                > way, and somewhere along the way it got converted to XHTML. This happens
                > because by default Dreamweaver specifies dynamic files as XHTML, but I
                > don't
                > know what I did that caused it to update some, but not all, of the tags.
                >
                > I have no idea how it happened, and cannot replicate it, but yesterday the
                > 'comment' image was intermittently not displaying on the server, and after
                > I
                > corrected the image tags it is. And the missing image in my demonstration
                > page
                > was not displaying because it wasn't on the server, and presumably it was
                > too
                > small for the server to show a cross to indicate it was missing.
                >
                >
                > Clancy


                • 5. Re: Trouble with images and PHP
                  Level 7
                  You are running Norton Internet Security, right? Welcome to the Norton
                  Nightmare.

                  --
                  Murray --- ICQ 71997575
                  Adobe Community Expert
                  (If you *MUST* email me, don't LAUGH when you do so!)
                  ==================
                  http://www.dreamweavermx-templates.com - Template Triage!
                  http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                  ==================


                  "Clancy" <clancy@cybec.com.au> wrote in message
                  news:5rg6k2tgr1rqqbtlqjofnkiibpjs6ucvuc@4ax.com...
                  > Clancy <clancy@cybec.com.au> wrote:
                  >
                  >>I have no idea how it happened, and cannot replicate it, but yesterday the
                  >>'comment' image was intermittently not displaying on the server, and after
                  >>I
                  >>corrected the image tags it is. And the missing image in my demonstration
                  >>page
                  >>was not displaying because it wasn't on the server, and presumably it was
                  >>too
                  >>small for the server to show a cross to indicate it was missing.
                  >
                  > I have been fiddling with my comments page all day, and the index page has
                  > been
                  > behaving consistently. I was about to go to bed, and loaded the index
                  > page for
                  > a final check, only to discover that the 'Comments and queries' button had
                  > disappeared again. I modified the source code to put a few question marks
                  > in
                  > front of it, and the relevant line of the source code now reads:
                  >
                  > <td width="9%"><!-- InstanceBeginEditable name="Comment_key" --><a
                  > href="Feedback.php" target="_blank">???<img src="Images/Comment.jpg"
                  > alt="Comments and queries" width="60" height="24" border="0" /></a><!--
                  > InstanceEndEditable --></td>
                  >
                  > Again the local version of the page displays correctly, but in the remote
                  > version the question marks show, but the image does not. The relevant
                  > line in
                  > the page actually displayed reads:
                  >
                  > <td width="9%"><!-- InstanceBeginEditable name="Comment_key" --><a
                  > href="Feedback.php" target="_blank">???
                  > </a><!-- InstanceEndEditable --></td>
                  >
                  > One strange feature about this line is that the image specification has
                  > been
                  > replaced by a number of spaces equal to the number of characters in the
                  > original
                  > specification.
                  >
                  > So for some reason the server is intermittently converting the image
                  > source
                  > clause to spaces. The copyright statement on the left, which uses php, is
                  > displaying correctly.
                  >
                  > Grrrrrr!!!!!!
                  >
                  > Clancy


                  • 6. Re: Trouble with images and PHP
                    Level 7
                    Murray *ACE* wrote:
                    >>This happens
                    >>because by default Dreamweaver specifies dynamic files as XHTML
                    >
                    > Only if you have selected that as the default.

                    XHTML 1.0 Transitional is the default for all web pages in Dreamweaver 8
                    uses. You now have to make a deliberate choice if you want HTML, not the
                    other way round.

                    --
                    David Powers
                    Adobe Community Expert
                    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
                    http://foundationphp.com/
                    • 7. Re: Trouble with images and PHP
                      Level 7
                      "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:

                      >You are running Norton Internet Security, right? Welcome to the Norton
                      >Nightmare.

                      Not knowingly. But I am running ZoneAlarm, and this seems to be the culprit.
                      It is working at the moment, after I have changed the image name from
                      comments.jpg to xclqry.jpg, and the file name from feedback.php to xcl_qry.php.
                      But it suddenly started working this morning about 11 o'clock, and it did the
                      same thing yesterday, and was working yesterday afternoon with the old name, so
                      I am tempted to suspect that it has some function that won't load yellow images
                      between 11 p.m. and 11 a.m!


                      Clancy
                      • 8. Re: Trouble with images and PHP
                        Level 7
                        Yes, I think that's it. Would you like to write a technote for Adobe about
                        this?

                        --
                        Murray --- ICQ 71997575
                        Adobe Community Expert
                        (If you *MUST* email me, don't LAUGH when you do so!)
                        ==================
                        http://www.dreamweavermx-templates.com - Template Triage!
                        http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                        http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                        http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                        ==================


                        "Clancy" <clancy@cybec.com.au> wrote in message
                        news:clt7k2d1h9ji6n76q9pjit2f3riajf54qv@4ax.com...
                        > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:
                        >
                        >>You are running Norton Internet Security, right? Welcome to the Norton
                        >>Nightmare.
                        >
                        > Not knowingly. But I am running ZoneAlarm, and this seems to be the
                        > culprit.
                        > It is working at the moment, after I have changed the image name from
                        > comments.jpg to xclqry.jpg, and the file name from feedback.php to
                        > xcl_qry.php.
                        > But it suddenly started working this morning about 11 o'clock, and it did
                        > the
                        > same thing yesterday, and was working yesterday afternoon with the old
                        > name, so
                        > I am tempted to suspect that it has some function that won't load yellow
                        > images
                        > between 11 p.m. and 11 a.m!
                        >
                        >
                        > Clancy


                        • 9. Re: Trouble with images and PHP
                          Level 7
                          "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:

                          >Yes, I think that's it. Would you like to write a technote for Adobe about
                          >this?

                          Do you mean a list of the names that ZoneAlarm blocks? If so, I will do a
                          little more research into the ones I know about, particularly under what
                          circumstances they are blocked, and what the symptoms are.

                          Would I send the results here, or to you, or somewhere else?


                          Clancy
                          • 10. Re: Trouble with images and PHP
                            Level 7
                            I was just kidding you. However, such a list would have value posted to
                            some webspace you control. Do you have any where this could go?

                            --
                            Murray --- ICQ 71997575
                            Adobe Community Expert
                            (If you *MUST* email me, don't LAUGH when you do so!)
                            ==================
                            http://www.dreamweavermx-templates.com - Template Triage!
                            http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                            http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                            http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                            ==================


                            "Clancy" <clancy@cybec.com.au> wrote in message
                            news:pnjbk2t7bu6b3b1os4aleoaabi54jn1oh4@4ax.com...
                            > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:
                            >
                            >>Yes, I think that's it. Would you like to write a technote for Adobe
                            >>about
                            >>this?
                            >
                            > Do you mean a list of the names that ZoneAlarm blocks? If so, I will do a
                            > little more research into the ones I know about, particularly under what
                            > circumstances they are blocked, and what the symptoms are.
                            >
                            > Would I send the results here, or to you, or somewhere else?
                            >
                            >
                            > Clancy


                            • 11. Re: Trouble with images and PHP
                              Level 7
                              "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote:

                              >I was just kidding you. However, such a list would have value posted to
                              >some webspace you control. Do you have any where this could go?

                              Have a look at: http://www.corybas.com/Technical/ZA_idiocy.php

                              I couldn't replicate the original bug, in which 'comment' appeared to be
                              blocked, but I have prepared a page demonstrating ZoneAlarm's handling of images
                              containing 'advert' in the path.

                              (And, having spent the morning organising the above, and trying to replicate the
                              original bug without success, I went back to my homepage where the "feedback"
                              envelope had been the cause of all this trouble, and it has disappeared again!
                              It was there all yesterday, and I haven't touched that page today. I said it
                              involved a time of day function!)

                              Clancy