Hi,
i am done with my site and ready to launch. But i dont want any IE6 user to visit my site. and i want a custom message for those dumb users to upgrade their browser.
Now i know i can put some browser specific statements in my php files. But what would be the best option to just display the message and do not display any content from my site if the user visits through IE.
in other words, i want to stop the execution of my site if you are from IE6.
Thanks,
<?php $browser= "1"; ?>
<!--[if !IE 6]>
<?php $browser= "0";
echo "this is under if condition <br />"; ?>
<![endif]-->
<?php
if ($browser== "0" ){
echo "some message ";
}
?>
Try this code
doesn't worked.
It changes the value of variable $browser on every browser !
Try this:
$using_ie6 = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALSE);
if($using_ie6){
// do something
// wp_die("please upgrade you browser, buddy! IE6? Are you Kidding me?", "Upgrade your Browser");
}
Ref: http://stackoverflow.com/questions/671890/can-i-detect-ie6-with-php
Thanks,
I used `
<!--[if lte IE 7]>
<script language="javascript">
window.location="http://mysite.com/update.php";
</script>
<![endif]-->`
So the users with old browsers are redirected to another page... where i can write any good things for those stone age internet surfers :)
Great! Its a javascript solution though. What about someone who using IE6 with javascript disabled ;) :)
which means i should do some meta redirection as well... :)