Bonjour,

je voudrais qu'en fonction du navigateur qui désire accéder à mon site web il soit redirigé sur une page web ou une autre.

Pour cela j'ai fait ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
        <head>
        <meta name="ROBOTS" content="NOINDEX,NOFOLLOW" />
        <title>Bienvenue sur mon site !</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" href="images/debian.ico" />
        <link rel="stylesheet" media="screen" type="text/css" title="resolution" href="index.css" />
        <?php
        //$_SERVER["HTTP_USER_AGENT"] : variable donnant le navigateur
        if (ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) {
            //Internet explorer
            header('Location: indexie.php');
        } else {
            //Les autres
            header('Location: indexo.php');
        }
        ?>
        </head>
        <body>
        </body>
</html>
si le navigateur= internet explorer -> indexie.php
sinon indexo.php

Cependant le navigateur me renvoie des erreurs php concernant les 2 header ?

Merci par avance pour votre aide.