Code: Select all
<?php
if (strstr ($_SERVER["HTTP_USER_AGENT"], "MSIE")) {
echo '<p>I see you are using <strong> Internet Explorer</strong> .</p>';
}
elseif (strstr ($_SERVER["HTTP_USER_AGENT"], "Firefox")) {
echo '<p>I see you are using <strong>Firefox</strong>.</p>';
}
elseif (strstr ($_SERVER["HTTP_USER_AGENT"], "Mozilla")) {
echo '<p>I see you are using <strong>Mozilla</strong>. </p>';
}
elseif (strstr ($_SERVER["HTTP_USER_AGENT"], "Opera")) {
echo '<p> I see you are using <strong>Opera </strong>. </p>';
}
elseif (strstr ($_SERVER["HTTP_USER_AGENT"], "Netscape")) {
echo '<p> I see you are using <strong>Opera </strong>. </p>';
}
elseif (strstr ($_SERVER["HTTP_USER_AGENT"], "Safari")) {
echo'<p> I see you are using <strong>Safari</strong>. </p>';
}
else {
echo '<p>I see you are using some other web browser. </p>';
}
?>Is this a limitation of $_SERVER["HTTP_USER_AGENT)] or can alter the script to get it to work for the intended browser detection?
thanks