AFAIK, there is no way to "force" any browser to send any HTTP headers let alone specific ones. Either they do or they don't.
Yeah, I found that out after trying it. I was skeptical, but quite hopeful that it would somehow end my quest. But, it didn't.
Actually, your code isn't testing for support, but for HTTP_ACCEPT headers, hence the difference between your echo message and the actual results.
Oh okay. I thought that by testing for HTTP_ACCEPT headers, it was implying / indirectly testing for support.
So the difference between the echo message and the actual results in browsers that support svg was due to the fact that there were no HTTP_ACCEPT headers to test. Thats why it resorted to the else. Is that right, or did I mess it up ?
Then it becomes more work.
Because after checking what support they have, one / we would have to interpret the results.
But then, here is where it gets really confusing for me:
To test if they send the headers with the request for the CSS file, you could add a line to your htaccess file redirecting requests for "headertest.css" to "headertest.php" - if - the headers don't get lost during the redirect, you could then have the value emailed to you or logged to a database.
I do not know if you would be willing to explain it differently because I am confused. But first can I give my understanding or what I thought you were saying and then you can see if I understood it correctly?
I understood it as...
1.) It becomes more work to interpret the results and check what HTTP_ACCEPT headers they are sending. And then react accordingly.
2) So first: If we see if the browser is correctly interpreting the link to a stylesheet** by sending an HTTP_ACCEPT request for it.
3.) Then, If it is sending for it, then use some syntax in the .htaccess file to redirect that request to a php file
4.) A PHP file that has code like what I posted in my first post. Which, checks if supports svg and if so provides styling with an svg image. Or if not, then styling with another format of widely-supported image (PNG, JPG, GIF)
*Having any lost requests emailed to be or logged in a db is just error checking. Which may happen due to all the detours and redirects, right?
**A stylesheet that just has styling to place the svg image / png image. Because it was all of the page's styling, once t figure out what type of image it should return, it would echo styling just for that image and not that whole original stylesheet
What do you think? Did I get it? :lol:
Again, Thank you ever so kindly— seriously.
With all Regards, Gratitude, and Respect,