bjr
j'ai 3fichiers

je fait l'authentification puis elle s'affiche la page filiere.php et quand je choisi une filiere normalement il affiche ce qu'il ya dans la page ajaxiinfo_list.php

dans ce fichier j'ai fait mais il m'aafiche cette erreur: Notice: Undefined index: code_ens in c:\www\gad\ajaxinfo_list.php on line 10


1er: gad_aut_prof.php //authentification
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
<? session_start()
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>التسيير الآلي للفروض  </title>
<style type="text/css">
<!--
.s1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	font-style: normal;
	line-height: normal;
	font-weight: bold;
	color: #800000;
}
body {
	background-image: url(fond2.jpg);
}
.s2 {
	font-size: 16px;
	font-style: normal;
	line-height: normal;
	font-weight: bold;
	color: #FFFF00;
}
.Style4 {
	color: #800000;
	font-weight: bold;
}
.Style5 {font-size: 18px}
.Style6 {color: #800000; font-weight: bold; font-size: 18px; }
.Style9 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-style: normal; line-height: normal; font-weight: bold; color: #FFF3E8; }
.Style10 {font-size: 24px}
-->
</style>
</head>
 
<body>
<form name="form1" method="post" action='filiere.php'>
  <p align="right"> </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="377" border="1" align="center" bgcolor="#FFF3E8">
    <tr background="Image/bouton_col.jpg">
      <th height="61" background="Image/bouton_col.jpg" scope="row"><p class="Style10"> الدخول بصفة أستاذ </p>      </th>
    </tr>
    <tr>
      <th height="215" scope="row"><p>
        <input name="code_ens" type="text" id="code_ens" size="20" />
          <span class="Style4 Style5">: إسم المستخدم </span> </p>
        <div align="right" class="Style4 Style5"></div>      
        <p>
          <input name="password" type="password" id="password" size="10"  maxlength="10" />          
        <span class="Style6">: كلمة المرور </span></p>
        <p>&nbsp;</p>        <p>
          <input name="effac" type="reset" class="s1" value="    مسح    " />
          <span class="Style9">        ااااااااااااااا
          </span>
          <input name="confirm" type="submit" class="s1" value="    تأكيد    " />
</p>      </th>
    </tr>
  </table>
  <p>&nbsp;</p>
 
  <div align="center"><!--début du lien vers ImaGimp -->
<a href="http://imagimp.free.fr" target="_blank"></a>
<!--fin du lien vers ImaGimp -->
</div>
  <p align="center">&nbsp;</p>
</form>	
 
 
</body>
</html>
le 2eme: filiere.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
 
<?php
require_once('connexion.php');
global $code_ens;
?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
.Style1 {
	color: #990000;
	font-weight: bold;
	font-size: 18px;
}
.Style2 {
	color: #000066;
	font-weight: bold;
}
.Style4 {color: #990000}
.Style5 {
	color: #990000;
	font-weight: bold;
	font-size: 18px;
}
.Style11 {
	color: #000099;
	font-weight: bold;
}
.Style15 {
	color: #006600;
	font-weight: bold;
}
body {
	background-color: #000099;
}
-->
</style>
<head>
<?php
 
 
 
 
?>
		<title>My webpage is rich</title>
		<script type='text/javascript'>
 
			function getXhr(){
                            var xhr = null;
				if(window.XMLHttpRequest){ // Firefox et autres
				   xhr = new XMLHttpRequest(); 
 
				}
				else if(window.ActiveXObject){ // Internet Explorer 
				   try {
							xhr = new ActiveXObject("Msxml2.XMLHTTP");
						} catch (e) {
							xhr = new ActiveXObject("Microsoft.XMLHTTP");
						}
				}
				else { // XMLHttpRequest non supporté par le navigateur 
				   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
				   xhr = false; 
				} 
                            return xhr;
			}
 
 
 
			/**
			* Méthode qui sera appelée sur le click du bouton
			*/
			 function change(){
 
				var xhr = getXhr();
 
				// On défini ce qu'on va faire quand on aura la réponse
				xhr.onreadystatechange = function(){
 
					// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
					if(xhr.readyState == 4 && xhr.status == 200){
						di = document.getElementById('info');
						di.innerHTML = xhr.responseText;
					}
				}
 
				// Ici on va voir comment faire du post
				xhr.open("POST","ajaxinfo_list.php",true);
 
				// ne pas oublier ça pour le post
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				// ne pas oublier de poster les arguments
				// ici, l'id de l'auteur
				idfiliere = document.getElementById('filiere').options[document.getElementById('filiere').selectedIndex].value;
 
				xhr.send("idfiliere="+idfiliere);
 
			} 
 
		</script>
</head>
	<body>
	<form name="form1" id="form1">
		  <div align="right">
		  </div>
		  liste des filieres
		  <fieldset   style= "background-color:#FFFFFF" "width:810px" align="center" ><table width="211" border="0" align="center" dir="rtl">
                <tr class="Style11">
                    <th width="205" height="53" scope="row"><label><span class="Style2">
                    <input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
                    <input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" /> 
                    filiere</span></label>
                      <select name='filiere' id='select' onChange='change()'>
                        <option value='-1'>اختيار شعبة</option>
                        <?php
 
						$res = mysql_query("SELECT * FROM filieres ORDER BY code_fil");
						while($row = mysql_fetch_assoc($res)){
							echo "<option value='".$row["code_fil"]."'>".$row["nom_fil"]."</option>";
						}
					?>
                      </select></th>
                  </tr>
<?php $code_ens=$_POST['code_ens'];
if(isset($_REQUEST["idfiliere"]))
{ //echo $_REQUEST["idfiliere"];
echo substr($_REQUEST["idfiliere"],0,1);
 
echo $code_ens;
echo $code_ens;
}
?>
          </table>
		    <label class="Style2"></label>
		    <div id='daira1' style='display:inline'>
			</div>
 
				<label class="Style2"></label><div id='commune1' style='display:inline'>
				</div>
 
				<label class="Style2"></label><div id='lycee1' style='display:inline'></div>
			    <p>
	      </fieldset>
		</p>
        </form>
 
 
		<div id='info'></div>
	</body>
</html>
et le 3eme: ajaxinfo_list.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
 
<?php
require_once('connexion.php');
 
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
	if(isset($_REQUEST["idfiliere"]))
{ //echo $_REQUEST["idfiliere"];
echo substr($_REQUEST["idfiliere"],0,1);
$code_ens=$_POST['code_ens'];
echo $code_ens;
$dossier='Gad_prof_rep/'.substr($code_ens,0,1).'/'.$_REQUEST["idfiliere"].'/'.substr($code_ens,1,4).'/'.'/';}
echo $dossier; 
 
 
 
 ?>
 
  </p>
<input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
<input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" />
<p><br>
</p>
<p>&nbsp;    </p>
    </div>
SVP qu'il le reconnait code_ens dans ajaxinfo_liste.php .
dans la page filiere.php il le reconnait .

comment le faire passer?