[AJAX] ajax et script php
bonjour j'ai un petit souci
je dois afficher ce fichier php :
Code:
1 2 3 4 5 6 7 8 9 10
| <?php
print"jjuste un essai";
?>
<script type="text/javascript">
alert("toto");
</script>
<?php
print"Date reportée :";
?> |
dans ce fichier :
Code:
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
| <html>
<head>
<script type="text/javascript" src="ongletValidation.js" ></script >
</head>
<body>
<br>
<br>
<?php
if(isset($_POST["report"]))
{
$tache=isset($_POST["choixTache"]);
if($tache=="saisieReporting")
{
?>
<!--<script type="text/javascript">
if(confirm("voulez vous continuer à faire le reporting?"))
afficheTypeLigne();
</script>
-->
<?php
print "je m'execute d'abord";
}
// if($tache=="saisiesReporting")
// {
//
// }
}
?>
<form method ="POST">
<label> Selectionnez une tâche : </label>
<select name = "choixTache" id="choixTache" onclick='afficheTache(this.value)'>
<option value="saisieReporting">saisie reporting</option>
<option value="saisiesReporting">saisies autres reporting</option>
<option value="visualisationReporting">visualisation reporting</option>
<option value="modifLigne">Modifs infos ligne</option>
<option value="modifValidation">Modifs infos validation</option>
</select>
<div id ="sectionTache">
</div>
</form>
</body>
</html> |
et j'utilise pour cela ajax das une fonction javascript dont voici le fichier:
Code:
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
| function afficheTache(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
if(str=="modifLigne")
{
var url="modifInfosLigne.php";
xmlhttp.onreadystatechange=ajaxmodifInfosLigne;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function ajaxmodifInfosLigne()
{
if (xmlhttp.readyState==4)
{
document.getElementById('sectionTache').innerHTML=xmlhttp.responseText;
}
} |
mon probleme: je remarque que la fonction alert n'est pas executée quand je lance le 2e fichier php, je n'y comprends rien!!!!!!!!!!!!!!!:(
quelqu'un aurait 'il une idee????????