9999) { $answer = "Nothing special" ; } else { $content = file_get_contents('numbers.txt') ; $pos = strpos($content, '=' . $valOne . '=') ; if($pos === false) { $answer = "Nothing special" ; } else { $pos = $pos + strlen('=' . $valOne . '=') ; $pos2 = strpos($content, "\n", $pos) ; // ($pos2 - $pos) > 255 : si jamais il y a un bug dans mon fichier de nombres if($pos2 === false || ($pos2 - $pos) > 255) { $answer = "Nothing special" ; } else { $answer = $valOne . ' ' . substr($content, $pos, $pos2 - $pos) ; } } } outputStylesheet($answer) ; } else { outputStylesheet(' ') ; exit() ; } //================================ // Génère la feuille de style avec la réponse du serveur insérée // dans la propriété "background-image" du div utilisé pour la communication //================================ function outputStylesheet($msg) { header("Expires: Sun, 1 Jan 2000 12:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Content-Type: text/css"); $msg = '==' . urlencode($msg) . '=='; echo " #divforajax { background-image: url($msg) ; } " ; exit() ; } ?>