Repository navigation
Expand file tree
/
Copy pathprocessing.php
More file actions
97 lines (74 loc) · 2.65 KB
/
Copy pathprocessing.php
File metadata and controls
97 lines (74 loc) · 2.65 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
ob_start();
session_start();
function curl_get($url) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true
]);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
function curl_post($url, $params) {
$postData = '';
foreach($params as $k => $v) {
$postData .= $k . '='.$v.'&';
}
rtrim($postData, '&');
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
]);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
if (isset($_POST['sorgula'])) {
$VergiKimlikNumarası = $_POST['vkn'];
$VergiDairesi = $_POST['vd'];
if ($_POST['jeton'] != $_SESSION['jeton']) {
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
Jeton geçerli değil.
</div>';
} elseif (!ctype_digit($VergiKimlikNumarası) or strlen($VergiKimlikNumarası) < 10 or strlen($VergiKimlikNumarası) > 10) {
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
Girilen vergi kimlik numarası geçerli değil.
</div>';
} elseif ($VergiDairesi == NULL) {
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
Seçilen vergi dairesi geçerli değil.
</div>';
} else {
$data = [
'vkn' => $VergiKimlikNumarası,
'vd' => $VergiDairesi
];
$post = curl_post('https://www.my-api.co/vkn.php', $data);
$decode = json_decode($post, true);
if ($decode['error'] == 1) {
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
'.$decode['message'].'
</div>';
} else {
echo '<div class="alert alert-info alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Durum:</b> ' . $decode['data']['status'] . ' - <b>Ünvan:</b> ' . $decode['data']['title'].'
</div>';
}
}
$_SESSION['jeton'] = rand(100000, 999999);
}
$_SESSION['jeton'] = rand(100000, 999999);
$token = $_SESSION['jeton'];
?>