Initial commit
[2ch-be.git] / dev-test / old_dev / confirmation.php
blobb980fa71d136287cbebcc8a8f7771e2757d4fc84
1 <html lang="en">
2 <head>
3 <meta charset="Shift_JIS">
4 <title>ƒ�ƒOƒCƒ“</title>
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <meta name="description" content="">
7 <meta name="author" content="">
8 <link rel="stylesheet" type="text/css" href="css/style.css"/>
9 </head>
10 <body>
11 <?php
12 include('config.php');
14 $g = $_GET;
15 if (isset($g['e']) && $g['e'] != '' && isset($g['k']) && $g['k'] != '') {
17 $email = trim($g['e']);
18 $key = trim($g['k']);
20 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
21 $key = filter_var($key, FILTER_SANITIZE_STRING);
23 if (!filter_var($email, FILTER_VALIDATE_EMAIL)){
24 echo "bad";
25 exit;
28 $email = strip_tags(addslashes($g['e']));
29 $key = strip_tags(addslashes($g['k']));
31 $fdir = substr($email, 0, 1);
32 $sdir = substr($email, 1, 1);
33 $data = @file(DB_PATH."$fdir/$sdir/$email");
35 if(count($data)>3){
36 for ($i=0; $i < count($data); $i++) {
37 $data[$i] = trim($data[$i]);
39 $mainkey = md5($data[1].$data[2]);
40 if ($mainkey != $key) {
41 $mainkey = hash("sha256", $data[1].$data[2]);
42 if($mainkey != $key) {
43 echo "Invalid Link";
44 exit;
47 if ($data[4] != 1) {
48 $ico = isset($data[5])?$data[5]:'nida.gif';
49 $writeData = $data[0]."\n".$data[1]."\n".$data[2]."\n1000\n1\n".$ico;
50 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
51 echo "’ljÁ‚³‚ꂽ1000”N‚̃|ƒCƒ“ƒg";
52 } else {
53 echo "Šù‚ÉŠm”F‚³‚ꂽ";
55 } else {
56 echo "ƒ†�[ƒU�[‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ";
58 } else {
59 echo "Error 3";
63 </body>
64 </html>