HTTP headers: What does this do?

  1. HTTP headers
  2. Examining headers

<?

setcookie('greeting', 'yes');

?>

<!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="en" lang="en">

<head>

<title>Mimsy Were the Borogoves</title>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<meta name="description" content="Hello, World." />

</head>

<body>

<h1>World</h1>

<?IF ($_COOKIE['greeting'] == 'yes'):?>

<p>World, say hello.</p>

<?ELSE:?>

<p>Please go away.</p>

<?ENDIF;?>

</body>

</html>

What will this page display? The answer has to do with HTTP headers and the way that browsers and servers communicate with each other.

  1. HTTP headers
  2. Examining headers