Initial commit
[2ch-be.git] / confirmation.php
blobd2d47763b4d54a5df53704f5bae675fb2d1467e7
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]."\n0\n1\n".$ico;
50 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
51 #echo "’ljÁ‚³‚ꂽ1000”N‚̃|ƒCƒ“ƒg";
52 echo "Done. Confirmed.";
53 } else {
54 echo "Šù‚ÉŠm”F‚³‚ꂽ";
56 } else {
57 echo "ƒ†�[ƒU�[‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ";
59 } else {
60 echo "Error 3";
64 </body>
65 </html>