views:

28

answers:

1

Well, I would like to know by HTTP headers if request is triggered by <img tag or by something else.

I assume that when request is called from <img tag, I'll not have */* variable in HTTP_ACCEPT or I'm missing something.

Regards

EDIT: I've tried with few browser but i can't conclude nothing by HTTP_ACCEPT...

A: 

No, sorry - a browser request made for an img tag will be identical to any other GET request - though as you point out, Firefox does give an Accept header specifying that it expects some kind of image but unless all browsers do this it's not very useful.

What's this for? There might be another way to do what you want.

Nick
well... not right... for image (at least for FF) is:image/png,image/*;q=0.8,*/*;q=0.5
confiq
So it does. I only actually checked Chrome and didn't think Firefox would bother. I'll update my answer a bit.
Nick
@confiq: That's not very reliable.
You
i need to detect in PHP request if it's image or not. It would be elegant solution using HTTP_ACCEPT...
confiq

related questions