Created
March 30, 2015 05:24
-
-
Save nomuken/99a7153a6ae571dfe0fe to your computer and use it in GitHub Desktop.
qso2のshop部分
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 | |
/** | |
* Created by IntelliJ IDEA. | |
* User: nomuken | |
* Date: 12/3/14 | |
* Time: 7:26 PM | |
*/ | |
$message = "「ふっふっふ,何用かね?」"; | |
if($_POST['name']==='0'||(isset($_POST['name'])&&!empty($_POST['name']))){ | |
$name=htmlspecialchars($_POST['name'],ENT_QUOTES,"UTF-8"); | |
$weapon=1; | |
$billing=0; | |
$json=array("name"=>$name,"weapon"=>$weapon,"billing"=>$billing); | |
setcookie("SESSION",base64_encode(json_encode($json)),time()+60*60*24); | |
}elseif(isset($_COOKIE['SESSION'])) { | |
$json=json_decode(base64_decode($_COOKIE['SESSION']),true); | |
$name=htmlspecialchars($json['name'],ENT_QUOTES,"UTF-8"); | |
$billing=(int)$json['billing']; | |
$weapon=(int)$json['weapon']>11||(int)$json['weapon']<1?1:(int)$json['weapon']; | |
}else{ | |
header("Location: index.php?m=bad access...",true,303); | |
exit(); | |
} | |
if(isset($_GET['m'])){ | |
if((int)$_GET['m']===1){ | |
$isUp=($billing===0)&&($weapon===9)?false:$weapon===rand(1,$weapon); | |
if($isUp||$billing===1){ | |
$message="「ふむ,成功のようだね」"; | |
$weapon=$weapon<10?$weapon+1:1; | |
$json=array("name"=>$name,"weapon"=>$weapon,"billing"=>$billing); | |
setcookie("SESSION",base64_encode(json_encode($json)),time()+60*60*24); | |
}else { | |
$message = "「すばらしく運が無いな,君はwwwwww」"; | |
$weapon -= 1; | |
$json = array("name" => $name, "weapon" => $weapon, "billing" => $billing); | |
setcookie("SESSION", base64_encode(json_encode($json)), time() + 60 * 60 * 24); | |
} | |
}elseif((int)$_GET['m']===2){ | |
setcookie("SESSION","",time()-1289731928734219873981731); | |
header("Location: index.php",true,303); | |
exit(); | |
} | |
} | |
if($weapon===10){ | |
$message="「すばらしく運が良いな,君は」<br>Congrats! flag is ... \"TDU{DoDoDoYouLike?}\""; | |
} | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>qso2 - アイテムラボ</title> | |
</head> | |
<body> | |
<article> | |
<h1>qso2 - アイテムラボ</h1> | |
<hr> | |
<p>こんにちは<?php echo $name; ?>さん,現在の武器「赤のTOUGHBOOK」のレベルは<?php echo $weapon;?>です</p> | |
<p><?php echo $message; ?></p> | |
<?php if(isset($errorMessage))echo "<p>".$errorMessage."</p>"; ?> | |
<a href="?m=1">強化する</a><br> | |
<a href="?m=2">リセットする</a><br> | |
<a href="http://bit.ly/nomuken">課金する</a> | |
</article> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment