File: ajax.php - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off01: <?php
02:
03: header ("Content-Type:text/html; charset=UTF-8");
04:
05: ?>
06:
07: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
08: <html xmlns="http://www.w3.org/1999/xhtml">
09: <head>
10: <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8" />
11: <script src="http://www.mirari.fr/template/pearl/inc/ajax.js" type="text/javascript"></script>
12: <title>Test</title>
13: </head>
14: <body>
15: <form action="" method="post">
16: <input id="text" name="text" type="text" />
17: <input type="submit" value="Form Send" />
18: <input onclick="XMLHttp.request('ajax.php', {text : document.getElementById ('text').value}, {action : 'extract', from : 'result', to : 'result'});" type="button" value="Ajax Send" />
19: </form>
20: <div id="result">
21: <?php
22:
23: foreach ($_POST as $key => $val)
24: echo "$key => $val<br />\n";
25:
26: ?>
27: </div>
28: </body>
29: </html>