Skip to content

Instantly share code, notes, and snippets.

@nilsmunch
Created May 21, 2014 15:31
Show Gist options
  • Save nilsmunch/f214b5309543dc621d04 to your computer and use it in GitHub Desktop.
Save nilsmunch/f214b5309543dc621d04 to your computer and use it in GitHub Desktop.
<?
session_start();
if ($_GET['action'] == 'reset') {
$_SESSION['SCORE'] = 0;
}
if ($_GET['action'] == 'up') {
$_SESSION['SCORE'] ++;
}
if ($_GET['sell']) {
$_SESSION['SCORE'] += 999;
}
if ($_GET) header('location:/');
echo '<title>Number game awesome time!</title>';
echo '<div style="text-align:center"><h1>Numberwang!</h1>';
echo '<hr><h1>'.(int)$_SESSION['SCORE'].'</h1>';
echo '<hr><a href="/?sell=bob" style="color:darkorange;font-weight:bold">Buy InApp Booster (10$)</a> &middot; <a href="/?action=up">Increment!</a>';
echo ' &middot; <a href="/?action=reset">Reset</a>';
echo '</div>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment