Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 24th, 2005, 12:48 AM
Werner Partner
Guest
 
Posts: n/a
Default Very strange error effect with <img

I use a page created by php.

It should show two pictures of a person an a short text.
If there are no picture, nothing is shown, if there is no text, nothing
is shown.

There a about 20 persons, some of them ghave two pictures, some of them
one or none. Some of them have text.

Every person has an indexword as for instance "meyer", there can be a
text for "meyer" (in a database), and there could be a "meyer.jpg" and a
"meyer_alt.jpg", the pictures show Meyer today and 40 years ago.

If in the list Meyer is clicked there is a link with "person.php?param=meyer

The php-scrupt looks for the pictures and shows them.

Now I have a very strange effect.
There are two brothers, they have indexes as henesr and henesw (Wolfgang
and Rainer), henesr.jpg and henesr_alt.jpg are found.
For henesw I don't have pictures, but nevertheless the pictures of
henesr are shown, so that we have the impression that the two brothers
are idnetical twins

The code is:

<img src="pics/henesw.jpg" alt="[aktuelles Foto]" border="0" height="250">
<img src="pics/henesw_alt.jpg" alt="[altes Foto]" border="0" height="250">

There are definetely not such files in the directory, there are only the
"r" files. Normally it is looked for henesw.jpg and it should not be found.

If I click with right mouse button (mozilla) on the picture and dial
"Download Picture", so I get the name "henesw.jpg", if I dial "Show the
picture", I get a picture "henesr.jpg"

I know this is really crazy and I could give more information, but first
perhaps I will find someone who had the same problem and knows, what to
do. I can give further information if necessary.

thanks for help (this is really embarrassing)

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
  #2  
Old July 24th, 2005, 12:48 AM
Andy Dingley
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

It was somewhere outside Barstow when Werner Partner
<kairos@sonoptikon.de> wrote:
[color=blue]
>I use a page created by php.[/color]

Then give us the URL and let us see the problem within milliseconds.
Expecting us to read and understand 50 lines of text is too much
effort. Sorry.

  #3  
Old July 24th, 2005, 12:48 AM
Werner Partner
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

Andy Dingley schrieb:[color=blue]
> It was somewhere outside Barstow when Werner Partner
> <kairos@sonoptikon.de> wrote:
>
>[color=green]
>>I use a page created by php.[/color]
>
>
> Then give us the URL and let us see the problem within milliseconds.
> Expecting us to read and understand 50 lines of text is too much
> effort. Sorry.
>[/color]

As there are personal data, I made a "test driver".

It's

http://www.wagenburg-9b66.de/test/personalia.php

There is a person "Rudolf Henes", param=henesr
and
"Werner Henes", param=henesw

Then there is me, "Werner Partner".

I copied my fotos (partner.jpg and partner_alt.jpg to
henesr.jpg and henesr_alt.jpg

_There is no henesw*.jpg on the Server_

If you dial "Werner Henes" you get the wrong picture though the
Sourcecode wants "henesr.jpg".

If you dial (mozilla) "Save Graphics", you get henesw.jpg, but if you
want to show the picture (mozilla), you get henesr.jpg.

perhaps it is mozilla, but IE shows the same effect.

Thanks for looking

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
  #4  
Old July 24th, 2005, 12:49 AM
Lachlan Hunt
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

Werner Partner wrote:[color=blue]
> http://www.wagenburg-9b66.de/test/personalia.php
> ...
> If you dial ...[/color]

Who's dialing anything? I'm not using an old rotary phone or computer
with any form of dial to access the web. Perhaps you meant "select" or
maybe "click" (although "click" has the same problem for people who
aren't using a mouse, as "dial" does for those not using an old rotary
phone; but it is at least more widely understood in this context).
[color=blue]
> "Werner Henes" you get the wrong picture though the Sourcecode wants
> "henesr.jpg".[/color]

Actually, the source code of the HTML is asking for henesw.jpg and
henesw_alt.jpg, but the server returns a 301 Moved Permanently response
in the HTTP headers for those requests.

Is this move intended to be permanent? Will you never have real
pictures of henesw available? If you will, you should change the
response to a 307 Temporary Redirect so browsers will be able to get
them when they become available, rather than automatically changing the
request based on the previously given 301 response.
[color=blue]
> If you dial (mozilla) "Save Graphics", you get henesw.jpg,[/color]

Mozilla uses the name of the image in the src attribute to determine the
default filename, regardless of the filename of the resultant request;
however, the image saved is the same one that is recieved (henesr.jpg in
this case).
[color=blue]
> but if you want to show the picture (mozilla), you get henesr.jpg.[/color]

That's correct. That is due to the 301 response mentioned earlier. In
fact, because of that, the browser will, for any future requests for
henesw.jpg or henesw_alt.jpg, automatically request the henesr versions.
The browser will remember that redirection until you clear its history.

The browser also shows the URI of the actual requested file as it should
because of the redirection.
[color=blue]
> perhaps it is mozilla, but IE shows the same effect.[/color]

It's not a problem with the browser, it's a problem with the way you've
configured your server which is causing the undesired effects.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
  #5  
Old July 24th, 2005, 12:49 AM
Werner Partner
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

Lachlan Hunt schrieb:
[color=blue]
> Werner Partner wrote:
>[color=green]
>> http://www.wagenburg-9b66.de/test/personalia.php
>> ...
>> If you dial ...[/color]
>
>
> Who's dialing anything? I'm not using an old rotary phone or computer
> with any form of dial to access the web. Perhaps you meant "select" or
> maybe "click" (although "click" has the same problem for people who
> aren't using a mouse, as "dial" does for those not using an old rotary
> phone; but it is at least more widely understood in this context).[/color]

Oh yes: select - in german language it's the same word.
[color=blue]
>[color=green]
>> "Werner Henes" you get the wrong picture though the Sourcecode wants
>> "henesr.jpg".[/color]
>
>
> Actually, the source code of the HTML is asking for henesw.jpg and
> henesw_alt.jpg, but the server returns a 301 Moved Permanently response
> in the HTTP headers for those requests.[/color]

Does this mean that the server gives a wrong picture???
[color=blue]
>
> Is this move intended to be permanent? Will you never have real
> pictures of henesw available? If you will, you should change the
> response to a 307 Temporary Redirect so browsers will be able to get
> them when they become available, rather than automatically changing the
> request based on the previously given 301 response.[/color]

It is so that some people send there picture, some not, some later.
Normally there is no problem, because there is the ALT-Tag which shows
"[aktuelle Bild]" and "[altes Bild]".

This works with all persons (about 20 in original version), but just
_not_ with henesw and henesr.

The central question is: Why does server give me "henesr.jpg", when I
want to have "henesw.jpg", that's what I did not really understand.

[some interesting explanations]

Thanks for these explanations, it makes clearer how this machine works.
Nevertheless my central question is not understood.

I made a new PHP-solution which works:

if (file_exists) {
show picture (for instance "henesr.jpg" or "henesr_alt.jpg")
} else {
show neutral frame ("rahmen.jpg" or "rahmen_alt.jpg")
}

(Of course "alt" means "old", as you saw on the pictures.

So my original problem is solved, nevertheless stayes the question about
the reason of this strange effect.

Thanks

Werner


--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
  #6  
Old July 24th, 2005, 12:49 AM
Chris Morris
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

Werner Partner <kairos@sonoptikon.de> writes:[color=blue]
> The central question is: Why does server give me "henesr.jpg", when I
> want to have "henesw.jpg", that's what I did not really understand.[/color]

I would guess that, if it's an Apache server, it has mod_speling
installed, which does a reasonable job of correcting mistyped URLs to
the 'corrected' version.

Your PHP solution of checking if the file exists before trying to
display it is a better approach anyway, though.

--
Chris
  #7  
Old July 24th, 2005, 12:49 AM
Werner Partner
Guest
 
Posts: n/a
Default Re: Very strange error effect with <img

Chris Morris schrieb:[color=blue]
> Werner Partner <kairos@sonoptikon.de> writes:
>[color=green]
>>The central question is: Why does server give me "henesr.jpg", when I
>>want to have "henesw.jpg", that's what I did not really understand.[/color]
>
>
> I would guess that, if it's an Apache server, it has mod_speling
> installed, which does a reasonable job of correcting mistyped URLs to
> the 'corrected' version.
>
> Your PHP solution of checking if the file exists before trying to
> display it is a better approach anyway, though.
>[/color]
I think so

thanks

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles