Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Created July 19, 2011 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwatson/1093786 to your computer and use it in GitHub Desktop.
Save andrewwatson/1093786 to your computer and use it in GitHub Desktop.
multiple cookies
<?php
if (isset($_COOKIE['one'])) {
$new_one = $_COOKIE['one'] += 1;
$new_two = $_COOKIE['two'] += 1;
setcookie('one', $new_one);
setcookie('two', $new_two);
$response = "One says " . $new_one . " but Two says ". $new_two;
} else {
setcookie('one', 1);
setcookie('two', 2);
$response = "First time through.";
}
header("Content-type: text/xml\n");
?>
<Response>
<Say><?php echo $response; ?></Say>
<Pause length="2" />
<Redirect />
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment