-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
51 lines (49 loc) · 1.37 KB
/
create.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
?>
<html>
<head>
<title>Third-Party Verification</title>
<meta charset="UTF-8">
</head>
<body>
<center>
<h2>Third-Party Verification</h2>
<hr>
<a href="/">Home Page</a><br><br>
<?php
require(__DIR__."/config/config.php");
require(__DIR__."/function/cURL-HTTP-function/curl.php");
$response=cURL_HTTP_Request('https://www.google.com/recaptcha/api/siteverify',array('secret'=>$config['reCAPTCHA']['secret_key'],'response'=>$_POST['g-recaptcha-response']));
if(json_decode($response->html)->success){
require(__DIR__."/function/facebook-php-sdk-v4/src/Facebook/autoload.php");
require(__DIR__."/function/SQL-function/sql.php");
require(__DIR__."/function/fblogin.php");
if($response=checklogin()){
$fbid = $response['id'];
$fbname = $response['name'];
$datetime = time();
$token = substr(md5($fbid.$datetime.$config['hash']), 0, 8);
$query = new query;
$query->dbname = $config['database']['dbname'];
$query->table = $config['database']['table'];
$query->value = array(
array('fbid',$fbid),
array('fbname',$fbname),
array('datetime',date("Y-m-d H:i:s",$datetime)),
array('token',$token)
);
INSERT($query);
$url = $config['url'].'?token='.$token;
echo $fbname."'s Identity Verification<br>";
echo '<a href="'.$url.'">'.$url.'</a>';
} else {
echo 'Not Login';
}
} else {
echo 'reCAPTCHA Fail';
}
?>
</center>
</body>
</html>