A
Anonymous
Guest
Your array declaration is wrong. If you specify a key for one element, you have to specify a key for all of them. So you have two choices:
OR
I personally recommend the first.
You should also consider using foreach() instead of while() for iterating through an entire array.
I also personally recommend not using this script in the first place. It's counter to common sense to turn away users based on their platform, and is the hallmark of arrogant and lazy web design. Not to mention you're going to turn away every user with this script, considering that all major browser have "Mozilla" or "MSIE" in the user-agent string.
Code:
<?
$browser = array (
'MSIE 5',
'MSIE 4',
'MSIE 3',
'MSIE',
'Mozilla'
);
?>
OR
Code:
<?
$browser = array (
0 => 'MSIE 5',
1 => 'MSIE 4',
2 => 'MSIE 3',
3 => 'MSIE',
4 => 'Mozilla'
);
?>
I personally recommend the first.
You should also consider using foreach() instead of while() for iterating through an entire array.
I also personally recommend not using this script in the first place. It's counter to common sense to turn away users based on their platform, and is the hallmark of arrogant and lazy web design. Not to mention you're going to turn away every user with this script, considering that all major browser have "Mozilla" or "MSIE" in the user-agent string.