Created
February 18, 2016 14:09
-
-
Save AndyNovo/aacc42d79c4871eead7a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
session_start(); | |
if (!isset($_SESSION["bananas"])){ | |
$_SESSION["bananas"] = 1; | |
$_SESSION["recent_bunch"] = 1; | |
} else { | |
$this_bunch = rand(1,5); | |
$_SESSION["bananas"] += $this_bunch; | |
$_SESSION["recent_bunch"] = $this_bunch; | |
} | |
echo "<p>You found a bunch of bananas containing ".$_SESSION["recent_bunch"]." bananas.</p>"; | |
echo "<p>Your total is now: ".$_SESSION["bananas"]." bananas. You lucky duck you.</p>" | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment