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
|
<?php
header('Content-type: text/html; charset=UTF-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<body >
<script type="text/javascript">
function maFonctionAjax(message, Mail,Nom)
{
var MaFontion;
if (window.XMLHttpRequest){ MaFontion = new XMLHttpRequest();}
else if (window.ActiveXObject) {MaFontion = new ActiveXObject('Microsoft.XMLHTTP');}
else {
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
MaFontion = false; }
MaFontion.open('POST',"tonphp.php",true);
MaFontion.onreadystatechange = function()
{
if (MaFontion.readyState == 4 && MaFontion.status==200)
{ document.getElementById 'LaReponse').innerHTML=''+MaFontion.responseText+'';
}
}
MaFontion.setRequestHeader('Content-type','application/x-www-form-urlencoded');
MaFontion.send('message='+message+'&Mail='+Mail+'&Nom='+Nom);
}
</script>
<br />
<form id='LeForm' name='LeForm' method='post' onsubmit="maFonctionAjax(this.message.value,this.Mail.value,this.Nom.value);return false" action='' >
Message <input name='message' id='message' type=text ><br />
<input name='Mail' id='Mail' type=text >
<input name='Nom' id='Nom' type=text >
<input type=submit value='envoyer' />
</form><br /><br />
<div id='LaReponse' class='LaReponse'>
</div></body></html> |