Fichier test/testHeader.php : if (isset($_GET['coffee'])) {
header("HTTP/1.1 418 I'm a teapot");
echo "\n<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<html><head>
<title>418 I'm a teapot</title>
</head><body>
<h1>I'm a teapot</h1>
<p>The requested URL <b>". $_SERVER['SCRIPT_NAME']."?". $_SERVER['QUERY_STRING']. "</b> tried to brew coffee with a teapot !</p>
</body></html>";
}
else {
header("HTTP/1.1 301 Moved Permanently");
if (isset($_GET['page'])) {
header('Location: /~dominique/PHP/coursHTTP.php?page=' . $_GET['page']);
}
else
header('Location: /~dominique/PHP/coursHTTP.php?page=0');
}