Bonjour,

depuis ce matin je cherche ou se trouve l'erreur dans mon script qui fonctionne sous firefox mais pas sous ie6. (Je dois développer pour ie6 société oblige).

J'ai une liste déroulante puis un onchange qui doit afficher un tableau avec des données d'une bdd mysql. Le tableau s'affiche mais sans les données. j'ai l'impression que la variable GET n'est pas transmise mais je séche.

(t1.php) :
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
<html>
<head>
<script type="text/javascript">
function getXhr(){
var xmlHttp = null;
if(window.XMLHttpRequest)
xmlHttp = new XMLHttpRequest();
else if(window.ActiveXObject){
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
    }
else {
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
xmlHttp = false;
}
return xmlHttp
}                     
 
function affichetab()
{
var xmlHttp = getXhr()
var reponse = document.getElementById('tab');
var selectEsp = document.getElementById('user');
var selectedEspece = selectEsp.options[selectEsp.selectedIndex].value;
var url = "result.php?";
var data = "user="+selectedEspece; url +=data;
xmlHttp.open("get",url,true);
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4 && xmlHttp.status==200) {
reponse.innerHTML = xmlHttp.responseText;}}
xmlHttp.send(null);
}
</script>
</head>
 
<body>
<br />
 
<?php include('connection.inc.php'); ?>
 
Sélectionnez :
<select id='user' name='user' onchange="affichetab()">
<option value='-1'>Aucun</option>
<?php
$res = mysql_query("SELECT cp_matriculaire FROM utilisateurs_sites GROUP BY cp_matriculaire ORDER BY cp_matriculaire");
while($row = mysql_fetch_array($res)){
echo "<option>".$row["cp_matriculaire"]."</option>";
}
?>
</select>                                
 
<br /><br />
<div id='tab'></div>
</body></html>
(result.php) :
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
23
 
<?php
include('connection.inc.php');
 
$q=$_GET["user"];
 
$sql="SELECT cp_matriculaire, site_utilisateur FROM utilisateurs_sites WHERE cp_matriculaire = '".$q."'";
$result = mysql_query($sql);
?>
<table border='1'>
<tr>
<th>Cp-mat</th>
<th>Site</th>
</tr>
<?php 
while($row = mysql_fetch_array($result))
  { ?>
  <tr>
  <td><?php echo $row['cp_matriculaire'] ?></td>
   <td><?php echo $row['site_utilisateur'] ?></td>
  </tr>
<?php } ?>
</table>
Merci pour votre aide.