Created
July 19, 2011 21:37
-
-
Save andrewwatson/1093786 to your computer and use it in GitHub Desktop.
multiple cookies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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