-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate.php
More file actions
40 lines (38 loc) · 855 Bytes
/
Copy pathvalidate.php
File metadata and controls
40 lines (38 loc) · 855 Bytes
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
<?php
session_start();
if(isset($_GET['firstname']) && isset($_GET['lastname']) && isset($_GET['captcha']) && ($_GET['captcha'] == 'CASSEN'))
{
$_SESSION['user'] = array('name' => $_GET['firstname'] + $_GET['lastname']);
header("Location: chat.php");
die();
}
//grab token
$token = $_GET['access_token'];
$url = "https://graph.facebook.com/me?access_token=".$token;
if(file_get_contents($url))
{
$user = json_decode(file_get_contents($url),true);
}
else
{
header("Location: fail.php");
}
if(isset($user['error']))
{
header("Location: fail.php");
}
$size = sizeof($user['education']) - 1;
$temp1 = $user['education'];
$temp2 = $temp1[$size];
$school = $temp2['school'];
$schoolname = $school['name'];
if(isset($schoolname))
{
$_SESSION['user'] = $user;
header("Location: chat.php");
}
else
{
header("Location: fail.php");
}
?>