Hi. I need a script that can detect if a mobile phone is able to read colour (jpg, gif)/black and white (wbmp) graphics so i can serve pictures based on whether the phone can read those file types.
Is there anyone who knows how this can be done? Thanks.
You can try to read the environment variable HTTP_ACCEPT.
In this Variable the browser should list all suported MIME Types.
i.e:
HTTP_ACCEPT 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*'
Thanks. I am able to read the HTTP_ACCEPT header. However I notice that some monochrome phones also accept .gif format. Do you know how I can differentiate a monochrome phone browser from a colour one from the HTTP_ACCEPT header information?
No I don't think so.
But you might check the HTTP_USER_AGENT variable and check it against a list of capabilities.
On comprehensive list is the WURFL.xml
You will find it at www.wurfl.com