comment passer un paramettre à la 3eme page, je nai pas pu l
Posté : 14 avr. 2009, 10:34
Bonjour,
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 que j'ai traité dans la page ajaxiinfo_list.php, il l'affiche dans la page filiere.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/B/COLOR
1er: gad_aut_prof.php //authentification
le 2eme: filiere.php
et le 3eme: ajaxinfo_list.php
comment le faire passer à la 3eme page, impossible de le passer avec $_POST,[/code][/php]
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 que j'ai traité dans la page ajaxiinfo_list.php, il l'affiche dans la page filiere.php
dans ce fichier j'ai fait
Code : Tout sélectionner
<? echo $code_ens; ?>1er: gad_aut_prof.php //authentification
Code : Tout sélectionner
<? 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> </p>
<p> </p>
<p> </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> </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> </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"> </p>
</form>
</body>
</html>
Code : Tout sélectionner
<?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
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>
Code : Tout sélectionner
<?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> </p>
</div>