En complèment du bout de code javascript posté précédemment (dont je posterait une version complètement plus mieux un peu plus tard), voilà un serveur d'application AJAX qui tient en quelques lignes de PHP:

<?php
 
if (array_key_exists('m', $_GET)) {
 
    header('Content-Type: text/xml');
 
    $func = 'xmlhttp_' . $_GET['m'];
 
    if (function_exists($func)) {
 
        echo '<response>', $func(), '</response>';
 
    } else {
 
        echo '<error>function unknown</error>';
 
    }
 
}
 
function xmlhttp_helloWorld() {
 
    return 'hello world !';
 
}
 
?>

Alors, heureuse ?