amel01

Inscris le 14/04/2009 à 10:41
  • Signature
    Amel
  • Nombre de sujets
    1
  • Nombre de messages
    1
  • Nombre de commentaires
    Aucun
  • Nombre de news
    Aucune
  • Niveau en PHP
    Débutant

Ses dernières news

Aucune news

Ses derniers sujets sur les forums

forum
amel01
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
  1. <? echo $code_ens; ?>


mais il m'aafiche cette erreur: [COLOR="DarkRed"]Notice: Undefined index: code_ens in c:\www\gad\ajaxinfo_list.php on line 10/B/COLOR


1er: gad_aut_prof.php //authentification
  1. <? session_start()
  2. ?>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <title>التسيير الآلي للفروض </title>
  8. <style type="text/css">
  9. <!--
  10. .s1 {
  11. font-family: Arial, Helvetica, sans-serif;
  12. font-size: 18px;
  13. font-style: normal;
  14. line-height: normal;
  15. font-weight: bold;
  16. color: #800000;
  17. }
  18. body {
  19. background-image: url(fond2.jpg);
  20. }
  21. .s2 {
  22. font-size: 16px;
  23. font-style: normal;
  24. line-height: normal;
  25. font-weight: bold;
  26. color: #FFFF00;
  27. }
  28. .Style4 {
  29. color: #800000;
  30. font-weight: bold;
  31. }
  32. .Style5 {font-size: 18px}
  33. .Style6 {color: #800000; font-weight: bold; font-size: 18px; }
  34. .Style9 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-style: normal; line-height: normal; font-weight: bold; color: #FFF3E8; }
  35. .Style10 {font-size: 24px}
  36. -->
  37. </style>
  38. </head>

  39. <body>
  40. <form name="form1" method="post" action='filiere.php'>
  41. <p align="right"> </p>
  42. <p> </p>
  43. <p> </p>
  44. <p> </p>
  45. <table width="377" border="1" align="center" bgcolor="#FFF3E8">
  46. <tr background="Image/bouton_col.jpg">
  47. <th height="61" background="Image/bouton_col.jpg" scope="row"><p class="Style10"> الدخول بصفة أستاذ </p> </th>
  48. </tr>
  49. <tr>
  50. <th height="215" scope="row"><p>
  51. <input name="code_ens" type="text" id="code_ens" size="20" />
  52. <span class="Style4 Style5">: إسم المستخدم </span> </p>
  53. <div align="right" class="Style4 Style5"></div>
  54. <p>
  55. <input name="password" type="password" id="password" size="10" maxlength="10" />
  56. <span class="Style6">: كلمة المرور </span></p>
  57. <p> </p> <p>
  58. <input name="effac" type="reset" class="s1" value=" مسح " />
  59. <span class="Style9"> ااااااااااااااا
  60. </span>
  61. <input name="confirm" type="submit" class="s1" value=" تأكيد " />
  62. </p> </th>
  63. </tr>
  64. </table>
  65. <p> </p>

  66. <div align="center"><!--début du lien vers ImaGimp -->
  67. <a href="http://imagimp.free.fr" target="_blank"></a>
  68. <!--fin du lien vers ImaGimp -->
  69. </div>
  70. <p align="center"> </p>
  71. </form>


  72. </body>
  73. </html>


le 2eme: filiere.php

  1. <?php
  2. require_once('connexion.php');
  3. global $code_ens;
  4. ?>
  5. <html>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <style type="text/css">
  8. <!--
  9. .Style1 {
  10. color: #990000;
  11. font-weight: bold;
  12. font-size: 18px;
  13. }
  14. .Style2 {
  15. color: #000066;
  16. font-weight: bold;
  17. }
  18. .Style4 {color: #990000}
  19. .Style5 {
  20. color: #990000;
  21. font-weight: bold;
  22. font-size: 18px;
  23. }
  24. .Style11 {
  25. color: #000099;
  26. font-weight: bold;
  27. }
  28. .Style15 {
  29. color: #006600;
  30. font-weight: bold;
  31. }
  32. body {
  33. background-color: #000099;
  34. }
  35. -->
  36. </style>
  37. <head>
  38. <?php




  39. ?>
  40. <title>My webpage is rich</title>
  41. <script type='text/javascript'>

  42. function getXhr(){
  43. var xhr = null;
  44. if(window.XMLHttpRequest){ // Firefox et autres
  45. xhr = new XMLHttpRequest();

  46. }
  47. else if(window.ActiveXObject){ // Internet Explorer
  48. try {
  49. xhr = new ActiveXObject("Msxml2.XMLHTTP");
  50. } catch (e) {
  51. xhr = new ActiveXObject("Microsoft.XMLHTTP");
  52. }
  53. }
  54. else { // XMLHttpRequest non supporté par le navigateur
  55. alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
  56. xhr = false;
  57. }
  58. return xhr;
  59. }



  60. /**
  61. * Méthode qui sera appelée sur le click du bouton
  62. */
  63. function change(){

  64. var xhr = getXhr();

  65. // On défini ce qu'on va faire quand on aura la réponse
  66. xhr.onreadystatechange = function(){

  67. // On ne fait quelque chose que si on a tout reçu et que le serveur est ok
  68. if(xhr.readyState == 4 && xhr.status == 200){
  69. di = document.getElementById('info');
  70. di.innerHTML = xhr.responseText;
  71. }
  72. }

  73. // Ici on va voir comment faire du post
  74. xhr.open("POST","ajaxinfo_list.php",true);

  75. // ne pas oublier ça pour le post
  76. xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  77. // ne pas oublier de poster les arguments

  78. idfiliere = document.getElementById('filiere').options[document.getElementById('filiere').selectedIndex].value;

  79. xhr.send("idfiliere="+idfiliere);

  80. }

  81. </script>
  82. </head>
  83. <body>
  84. <form name="form1" id="form1">
  85. <div align="right">
  86. </div>
  87. liste des filieres
  88. <fieldset style= "background-color:#FFFFFF" "width:810px" align="center" ><table width="211" border="0" align="center" dir="rtl">
  89. <tr class="Style11">
  90. <th width="205" height="53" scope="row"><label><span class="Style2">
  91. <input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
  92. <input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" />
  93. filiere</span></label>
  94. <select name='filiere' id='select' onChange='change()'>
  95. <option value='-1'>اختيار شعبة</option>
  96. <?php

  97. $res = mysql_query("SELECT * FROM filieres ORDER BY code_fil");
  98. while($row = mysql_fetch_assoc($res)){
  99. echo "<option value='".$row["code_fil"]."'>".$row["nom_fil"]."</option>";
  100. }
  101. ?>
  102. </select></th>
  103. </tr>
  104. <?php $code_ens=$_POST['code_ens'];
  105. if(isset($_REQUEST["idfiliere"]))
  106. { //echo $_REQUEST["idfiliere"];
  107. echo substr($_REQUEST["idfiliere"],0,1);

  108. echo $code_ens;
  109. echo $code_ens;
  110. }
  111. ?>
  112. </table>
  113. <label class="Style2"></label>
  114. <div id='daira1' style='display:inline'>
  115. </div>

  116. <label class="Style2"></label><div id='commune1' style='display:inline'>
  117. </div>

  118. <label class="Style2"></label><div id='lycee1' style='display:inline'></div>
  119. <p>
  120. </fieldset>
  121. </p>
  122. </form>


  123. <div id='info'></div>
  124. </body>
  125. </html>


et le 3eme: ajaxinfo_list.php
  1. <?php
  2. require_once('connexion.php');

  3. ?>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <?
  6. if(isset($_REQUEST["idfiliere"]))
  7. { //echo $_REQUEST["idfiliere"];
  8. echo substr($_REQUEST["idfiliere"],0,1);
  9. $code_ens=$_POST['code_ens'];
  10. echo $code_ens;
  11. $dossier='Gad_prof_rep/'.substr($code_ens,0,1).'/'.$_REQUEST["idfiliere"].'/'.substr($code_ens,1,4).'/'.'/';}
  12. echo $dossier;



  13. ?>

  14. </p>
  15. <input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
  16. <input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" />
  17. <p><br>
  18. </p>
  19. <p> </p>
  20. </div>


comment le faire passer à la 3eme page, impossible de le passer avec $_POST,
Amel

Ses derniers messages sur les forums

forum
amel01
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
  1. <? echo $code_ens; ?>


mais il m'aafiche cette erreur: [COLOR="DarkRed"]Notice: Undefined index: code_ens in c:\www\gad\ajaxinfo_list.php on line 10/B/COLOR


1er: gad_aut_prof.php //authentification
  1. <? session_start()
  2. ?>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <title>التسيير الآلي للفروض </title>
  8. <style type="text/css">
  9. <!--
  10. .s1 {
  11. font-family: Arial, Helvetica, sans-serif;
  12. font-size: 18px;
  13. font-style: normal;
  14. line-height: normal;
  15. font-weight: bold;
  16. color: #800000;
  17. }
  18. body {
  19. background-image: url(fond2.jpg);
  20. }
  21. .s2 {
  22. font-size: 16px;
  23. font-style: normal;
  24. line-height: normal;
  25. font-weight: bold;
  26. color: #FFFF00;
  27. }
  28. .Style4 {
  29. color: #800000;
  30. font-weight: bold;
  31. }
  32. .Style5 {font-size: 18px}
  33. .Style6 {color: #800000; font-weight: bold; font-size: 18px; }
  34. .Style9 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-style: normal; line-height: normal; font-weight: bold; color: #FFF3E8; }
  35. .Style10 {font-size: 24px}
  36. -->
  37. </style>
  38. </head>

  39. <body>
  40. <form name="form1" method="post" action='filiere.php'>
  41. <p align="right"> </p>
  42. <p> </p>
  43. <p> </p>
  44. <p> </p>
  45. <table width="377" border="1" align="center" bgcolor="#FFF3E8">
  46. <tr background="Image/bouton_col.jpg">
  47. <th height="61" background="Image/bouton_col.jpg" scope="row"><p class="Style10"> الدخول بصفة أستاذ </p> </th>
  48. </tr>
  49. <tr>
  50. <th height="215" scope="row"><p>
  51. <input name="code_ens" type="text" id="code_ens" size="20" />
  52. <span class="Style4 Style5">: إسم المستخدم </span> </p>
  53. <div align="right" class="Style4 Style5"></div>
  54. <p>
  55. <input name="password" type="password" id="password" size="10" maxlength="10" />
  56. <span class="Style6">: كلمة المرور </span></p>
  57. <p> </p> <p>
  58. <input name="effac" type="reset" class="s1" value=" مسح " />
  59. <span class="Style9"> ااااااااااااااا
  60. </span>
  61. <input name="confirm" type="submit" class="s1" value=" تأكيد " />
  62. </p> </th>
  63. </tr>
  64. </table>
  65. <p> </p>

  66. <div align="center"><!--début du lien vers ImaGimp -->
  67. <a href="http://imagimp.free.fr" target="_blank"></a>
  68. <!--fin du lien vers ImaGimp -->
  69. </div>
  70. <p align="center"> </p>
  71. </form>


  72. </body>
  73. </html>


le 2eme: filiere.php

  1. <?php
  2. require_once('connexion.php');
  3. global $code_ens;
  4. ?>
  5. <html>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <style type="text/css">
  8. <!--
  9. .Style1 {
  10. color: #990000;
  11. font-weight: bold;
  12. font-size: 18px;
  13. }
  14. .Style2 {
  15. color: #000066;
  16. font-weight: bold;
  17. }
  18. .Style4 {color: #990000}
  19. .Style5 {
  20. color: #990000;
  21. font-weight: bold;
  22. font-size: 18px;
  23. }
  24. .Style11 {
  25. color: #000099;
  26. font-weight: bold;
  27. }
  28. .Style15 {
  29. color: #006600;
  30. font-weight: bold;
  31. }
  32. body {
  33. background-color: #000099;
  34. }
  35. -->
  36. </style>
  37. <head>
  38. <?php




  39. ?>
  40. <title>My webpage is rich</title>
  41. <script type='text/javascript'>

  42. function getXhr(){
  43. var xhr = null;
  44. if(window.XMLHttpRequest){ // Firefox et autres
  45. xhr = new XMLHttpRequest();

  46. }
  47. else if(window.ActiveXObject){ // Internet Explorer
  48. try {
  49. xhr = new ActiveXObject("Msxml2.XMLHTTP");
  50. } catch (e) {
  51. xhr = new ActiveXObject("Microsoft.XMLHTTP");
  52. }
  53. }
  54. else { // XMLHttpRequest non supporté par le navigateur
  55. alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
  56. xhr = false;
  57. }
  58. return xhr;
  59. }



  60. /**
  61. * Méthode qui sera appelée sur le click du bouton
  62. */
  63. function change(){

  64. var xhr = getXhr();

  65. // On défini ce qu'on va faire quand on aura la réponse
  66. xhr.onreadystatechange = function(){

  67. // On ne fait quelque chose que si on a tout reçu et que le serveur est ok
  68. if(xhr.readyState == 4 && xhr.status == 200){
  69. di = document.getElementById('info');
  70. di.innerHTML = xhr.responseText;
  71. }
  72. }

  73. // Ici on va voir comment faire du post
  74. xhr.open("POST","ajaxinfo_list.php",true);

  75. // ne pas oublier ça pour le post
  76. xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  77. // ne pas oublier de poster les arguments

  78. idfiliere = document.getElementById('filiere').options[document.getElementById('filiere').selectedIndex].value;

  79. xhr.send("idfiliere="+idfiliere);

  80. }

  81. </script>
  82. </head>
  83. <body>
  84. <form name="form1" id="form1">
  85. <div align="right">
  86. </div>
  87. liste des filieres
  88. <fieldset style= "background-color:#FFFFFF" "width:810px" align="center" ><table width="211" border="0" align="center" dir="rtl">
  89. <tr class="Style11">
  90. <th width="205" height="53" scope="row"><label><span class="Style2">
  91. <input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
  92. <input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" />
  93. filiere</span></label>
  94. <select name='filiere' id='select' onChange='change()'>
  95. <option value='-1'>اختيار شعبة</option>
  96. <?php

  97. $res = mysql_query("SELECT * FROM filieres ORDER BY code_fil");
  98. while($row = mysql_fetch_assoc($res)){
  99. echo "<option value='".$row["code_fil"]."'>".$row["nom_fil"]."</option>";
  100. }
  101. ?>
  102. </select></th>
  103. </tr>
  104. <?php $code_ens=$_POST['code_ens'];
  105. if(isset($_REQUEST["idfiliere"]))
  106. { //echo $_REQUEST["idfiliere"];
  107. echo substr($_REQUEST["idfiliere"],0,1);

  108. echo $code_ens;
  109. echo $code_ens;
  110. }
  111. ?>
  112. </table>
  113. <label class="Style2"></label>
  114. <div id='daira1' style='display:inline'>
  115. </div>

  116. <label class="Style2"></label><div id='commune1' style='display:inline'>
  117. </div>

  118. <label class="Style2"></label><div id='lycee1' style='display:inline'></div>
  119. <p>
  120. </fieldset>
  121. </p>
  122. </form>


  123. <div id='info'></div>
  124. </body>
  125. </html>


et le 3eme: ajaxinfo_list.php
  1. <?php
  2. require_once('connexion.php');

  3. ?>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <?
  6. if(isset($_REQUEST["idfiliere"]))
  7. { //echo $_REQUEST["idfiliere"];
  8. echo substr($_REQUEST["idfiliere"],0,1);
  9. $code_ens=$_POST['code_ens'];
  10. echo $code_ens;
  11. $dossier='Gad_prof_rep/'.substr($code_ens,0,1).'/'.$_REQUEST["idfiliere"].'/'.substr($code_ens,1,4).'/'.'/';}
  12. echo $dossier;



  13. ?>

  14. </p>
  15. <input name="code_ens" type="hidden" id="code_ens" value="<? echo $_POST['code_ens']; ?>" />
  16. <input name="password" type="hidden" id="password" value="<? echo $_POST['password']; ?>" />
  17. <p><br>
  18. </p>
  19. <p> </p>
  20. </div>


comment le faire passer à la 3eme page, impossible de le passer avec $_POST,
Amel

Ses derniers commentaires de news

Aucun commentaire de news

Ses derniers commentaires de sites

Aucun commentaire de sites

Ses derniers commentaires de wall

Aucun commentaire wall
LoadingChargement en cours