-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.php
47 lines (41 loc) · 1.03 KB
/
load.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
<?php
session_start();
session_destroy();
include 'methods/main.php';
include 'class/curl.class.php';
$login = 'kempanchik@mail.ru';
$password = '38q8jd9f38q8jd9F';
$url = 'https://www.space-track.org/ajaxauth/login';
$data = 'identity=' . $login . '&password=' . $password;
$c = new cURL;
$auth = trim($c->post($url, $data), '"');
echo '<pre>';
if (empty($auth)) {
$data = [];
$file = getFile($c);
$handle = @fopen("data/" . $file, "r");
$index = 0;
while ($line = fgets($handle, 8192)) {
switch ($index % 3){
case 0:
firstLine($line, $data);
break;
case 1:
secondLine($line, $data);
break;
case 2:
thirdLine($line, $data);
createQuery($data, $prepare_query_s, 's');
createQuery($data, $prepare_query_d, 'd');
$data = [];
break;
}
$index++;
}
insert($prepare_query_s, 's');
insert($prepare_query_d, 'd');
fclose($handle);
echo getReport();
} else {
print_r(json_decode($auth));
}