Trying to display an image only for Android users, but I don’t want to use any redirection for it.
So far I have this, but it uses header() which redirects.
if (strstr($_SERVER['HTTP_USER_AGENT'],"Android")) {
header("Location: app.png");
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can just output the image in your page, using readfile. Make sure to send the correct headers as well.
For example:
This way any request made to your page using Android will result in the raw image being returned. If you want to ‘force’ the client to download the image send the
content-dispositionheader as well.