Albert: Korrektur des php-scriptes

Beitrag lesen

Ich wollte keine Diskussion über den Sinn und Zweck entfachen, sondern schlicht einfach nur diese Information erhalten. Gut, eine Info habe ich: die Funktion ereg ist "veraltet", d.h. soll ich sie mit preg_match ersetzen?

Also so?

<?php 
    $IE6 = (preg_match('MSIE 6',$_SERVER['HTTP_USER_AGENT'])) ? true : false;
    $IE7 = (preg_match('MSIE 7',$_SERVER['HTTP_USER_AGENT'])) ? true : false;
    $IE8 = (preg_match('MSIE 8',$_SERVER['HTTP_USER_AGENT'])) ? true : false;
    $IE8 = (preg_match('MSIE 9',$_SERVER['HTTP_USER_AGENT'])) ? true : false;
    $IE8 = (preg_match('MSIE 10',$_SERVER['HTTP_USER_AGENT'])) ? true : false;

if (($IE6 == 1) || ($IE7 == 1) || ($IE8 == 1 || ($IE9 == 1 || ($IE10 == 1)) {
    header("Location: http://www.meinewebseite.de/noie.html");
    exit;

} else {} ?>

// mache hier normal mit html weiter...

html
body

...

Gruss Albert

[Vollzitat entfernt]