· 6 years ago · Nov 16, 2019, 01:42 PM
1<?php
2
3namespace App\Http\Controllers;
4
5use Illuminate\Http\Request;
6use \App\Rules\Count;
7use DB;
8
9class LikeController extends Controller
10{
11 public function __construct()
12 {
13 $this->middleware(function ($request, $next) {
14 if(auth()->check()){
15
16 //SET PERMISSION WHO CAN VISIT THIS CONTROLLER
17 $allow = ['admin', 'member', 'reseller', 'priority', 'junior'];
18
19 $level = auth()->user()->level;
20 if(!in_array($level, $allow)){
21 abort(505);
22 }
23 }
24 else{
25 return redirect('/login');
26 }
27 return $next($request);
28 });
29 }
30
31 public function likes($id)
32 {
33 $level = auth()->user()->level;
34
35 // if($id == 3){
36 // if($level !== 'admin'){
37 // return back();
38 // }
39 // }
40
41 if($id > 4 ){
42 return back();
43 }
44
45
46
47 if($id < 1 ){
48 return back();
49 }
50
51
52
53
54
55 $sev1 = \App\History::where('submitted_by', \Auth::User()->username)
56 ->where('type', 'Like Server 1')
57 ->whereDate('created_at', '=', date('Y-m-d'))->count();
58
59 $sev2 = \App\History::where('submitted_by', \Auth::User()->username)
60 ->where('type', 'Like Server 2')
61 ->whereDate('created_at', '=', date('Y-m-d'))->count();
62 $sev4 = \App\History::where('submitted_by', \Auth::User()->username)
63 ->where('type', 'Like Server 4')
64 ->whereDate('created_at', '=', date('Y-m-d'))->count();
65
66
67 $ceksisa = \App\History::where('submitted_by', \Auth::User()->username)
68 ->where('type', 'Like Server 3')
69 ->whereDate('created_at', '=', date('Y-m-d'))->sum('total_submit');
70
71 $pesan = '';
72 return view('server.likes',compact('id', 'pesan', 'sev1', 'sev2', 'sev4', 'ceksisa'));
73 }
74
75 public function isJson($string) {
76 return ((is_string($string) &&
77 (is_object(json_decode($string)) ||
78 is_array(json_decode($string))))) ? true : false;
79 }
80
81 public function getLikeCount($url){
82 if(preg_match('/taken-by/', $url)){
83 $url = $url;
84 $url .= "&__a=1";
85 }
86 else{
87 $url = $url."?__a=1";
88 }
89
90 $getContent = file_get_contents($url);
91 $dataContent = json_decode($getContent, 1);
92
93 if(!$this->isJson($getContent)){
94 echo "Url tidak ditemukan.";
95 }else{
96 echo $dataContent['graphql']['shortcode_media']['edge_media_preview_like']['count'];
97 }
98 }
99
100 public function order($id){
101
102 $url = request()->url;
103 if($url == NULL){
104 $pesan = 'Mohon isi form url terlebih dahulu !';
105 session()->flash('nulx', $pesan);
106 return redirect('service/like/'.$id);
107 }
108
109 $jmlsub = request()->jumlah;
110 if($jmlsub == NULL){
111 $pesan = 'Mohon isi form jumlah submit terlebih dahulu !';
112 session()->flash('nulx', $pesan);
113 return redirect('service/like/'.$id);
114 }
115
116 if(\Auth::User()->username == 'Demo'){
117 $pesan = "SUKSES";
118 session()->flash('result', $pesan);
119 return redirect('service/like/'.$id);
120 }
121
122
123
124 $level = auth()->user()->level;
125
126 $dcode = 'minute';
127 if($level == 'admin'){
128 $delay = 0;
129 }else if($level == 'reseller' || $level == 'member'){
130$delayxx = \App\History::where('submitted_by', \Auth::User()->username)->where('type', 'Like Server '. $id)->whereDate('created_at', '=', date('Y-m-d'))->count();
131 if($delayxx <= 3){
132 $delay = 30;
133 }else if($delayxx < 4){
134 $delay = 200;
135 }else{
136 $delay = 6;
137 $dcode = 'hour';
138 }
139 }else if($level == 'priority'){
140
141 if($id == 1){
142 $delay = 80;
143 }else{
144 $delayxx = \App\History::where('submitted_by', \Auth::User()->username)->where('type', 'Like Server '. $id)->whereDate('created_at', '=', date('Y-m-d'))->count();
145 if($delayxx <= 1){
146 $delay = 20;
147 }else if($delayxx < 2){
148 $delay = 50;
149 }else{
150 $delay = 1;
151 $dcode = 'hour';
152 }
153 }
154 }else{
155 $delay = 50;
156 }
157
158
159
160 // if($level == 'admin'){
161 // $delay = 0;
162 // }else if($level == 'priority'){
163 // $delay = 15;
164 // }elseif($level == 'reseller'){
165 // $delayxx = \App\History::where('submitted_by', \Auth::User()->username)
166 // ->where('type', 'Like Server '. $id)
167 // ->whereDate('created_at', '=', date('Y-m-d'))->count();
168
169 // if($delayxx > 15){
170 // $dcode = 'hour';
171 // $delay = 1;
172 // }else{
173 // if($jmlsub <= 1000){
174 // $delay = 5;
175 // }else{
176 // $delay = 8;
177 // }
178 // }
179 // }else{
180 // $delayxx = \App\History::where('submitted_by', \Auth::User()->username)
181 // ->where('type', 'Like Server '. $id)
182 // ->whereDate('created_at', '=', date('Y-m-d'))->count();
183 // if($delayxx < 2){
184 // $delay = 8;
185 // }else if($delayxx < 10){
186 // $delay = 10;
187 // }else if($delayxx < 15){
188 // $delay = 20;
189 // }else if($delayxx < 20){
190 // $delay = 60;
191 // $delay = 3;
192 // $dcode = 'hour';
193 // }
194
195 // if($jmlsub > 1000){
196 // $delay = $delay * 2;
197 // }
198
199 // }
200
201
202
203
204 error_reporting(0);
205
206 $c=curl_init('https://api.instagram.com/oembed/?url='.trim($url));
207 curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
208 curl_setopt($c,CURLOPT_SSL_VERIFYPEER,0);
209 curl_setopt($c,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0");
210 $x=curl_exec($c);
211 $mama=curl_getinfo($c);
212 curl_close($c);
213 preg_match('#provider_url#',$x);
214 $obj = json_decode($x,true);
215 $media = $obj['media_id'];
216 $authid = $obj['author_id'];
217
218 $cc=curl_init($url);
219 curl_setopt($cc,CURLOPT_RETURNTRANSFER,1);
220 curl_setopt($cc,CURLOPT_SSL_VERIFYPEER,0);
221 curl_setopt($cc,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0");
222 $x1=curl_exec($cc);
223 $mama1=curl_getinfo($cc);
224 curl_close($cc);
225 preg_match('/\"edge_media_preview_like\"\:\s?\{\"count\"\:\s?([0-9]+)/',$x1,$l);
226 $ses_data['start'] = $l[1];
227
228 $ses_data['target'] = request()->url;
229
230 session()->flash('ses_data', $ses_data);
231
232 // $result = $this->curl($apiku,'url='.request()->url.'&jumlah='.request()->jumlah.'&server=like'.$id);
233
234
235
236
237 $cekhisto = DB::table('users_history')->where('target', request()->url)->count();
238
239 if($id == 1 || $id == 2 || $id == 4){
240
241
242 if($id == 1){
243 /*
244 === | UBAI | ===
245 $jeda = 'like_5';
246 $type = 'Like Server 1';
247 $max = 200;
248 $types = 112;
249 */
250
251 $jeda = 'like_5';
252
253 $max = 100;
254 $type = 'Like Server 1';
255 $types = 306;
256 }else if($id == 2){
257 if($level == 'priority' || $level == 'member' || $level == 'reseller' ){
258 $jeda = 'like_5';
259 }else{
260 $jeda = 'like_1';
261 }
262 $max = 100;
263 $type = 'Like Server 2';
264 $types = 306;
265
266 }else if($id == 4){
267 if($level == 'priority' || $level == 'member' || $level == 'reseller' ){
268 $jeda = 'like_5';
269 }else{
270 $jeda = 'like_1';
271 }
272 $max = 200;
273 $type = 'Like Server 4';
274 $types = 306;
275
276 }else{
277 $max = 300;
278 $jeda = 'like_6';
279 $type = 'Like Server 3';
280
281 }
282
283 if($id == 1){
284 if($level == 'priority'){
285 $limsev = 3;
286 }else if($level == 'member'){
287 $limsev = 10;
288 }else if($level == 'reseller'){
289 $limsev = 10;
290 }
291 }else{
292 if($level == 'priority'){
293 $limsev = 3;
294 }else if($level == 'member'){
295 $limsev = 10;
296 }else if($level == 'reseller'){
297 $limsev = 10;
298 }
299 }
300
301 if($id == 1){
302 $apikey = "7edd7db27bbde12fc861332c77438b09"; // API Key Anda
303 $fitur = "Likess"; // Fitur Layanan, tersedia: Likes, Followers, Comment
304 $postdata = "apikey=$apikey&fitur=$fitur&target=".request()->url."&jumlah=".request()->jumlah;
305
306
307 /*
308 $key = '2019gantidiaivanbangsatbocahtolol';
309 $api = 'https://followers-gratis.com/api.php';
310
311 $postdata = 'api='.$key.'&action=add&link='.request()->url.'&type='.$types.'&quantity='.request()->jumlah;
312 */
313 }else if($id == 2){
314 $key = 'Ah8Zf93do6Krt0cPOYNMeVE5BXwnUL';
315 $api = 'https://mentalispanel.id/api/json.php';
316
317 $postdata = 'api_key='.$key.'&action=order&data='.request()->url.'&service=3681000&quantity='.request()->jumlah;
318 }else if($id == 4){
319 $key = '8720c4cf64113883f90137eff2b3dfc9';
320 $api = 'https://bulkfollows.com/api/v2';
321
322 $postdata = 'key='.$key.'&action=add&service=596&link='.request()->url.'&quantity='.request()->jumlah;
323 }else{
324 // $postdata = 'url='.request()->url.'&jumlah='.request()->jumlah;
325 $api_key = "2a0f5e54fd05ab70f4febc66cab183f1";
326 $pid = 1613;
327 $post_link = request()->url;
328 $post_quantity = request()->jumlah;
329
330 $order_postdata = "key=$api_key&action=add&service=$pid&link=$post_link&quantity=$post_quantity";
331 }
332
333
334 $sev = \App\History::where('submitted_by', \Auth::User()->username)
335 ->where('type', 'Like Server '. $id)
336 ->whereDate('created_at', '=', date('Y-m-d'))->count();
337
338 if($level == 'priority' || $level == 'member' || $level == 'reseller' ){
339 if($sev > $limsev){
340 session()->flash('ses_lim', 'Maaf Saat Ini Kamu Limit Server Sudah Habis Harap Tunggu Esok Pagi Untuk Submit Ulang !');
341 return redirect()->back();
342 }
343 }
344
345
346
347 // if($id == 1){
348 // $result = $this->curl('http://curl.pengikut.id/ivlike1.php','urlxx='.request()->url.'&jumlahlahx='.request()->jumlah);
349 // }else{
350 // $result = $this->curl('http://curl.pengikut.id/ivlike2.php','urlxx='.request()->url.'&jumlahlahx='.request()->jumlah);
351 // }
352
353 if($id == 1){
354 $ch = curl_init();
355 curl_setopt($ch, CURLOPT_URL, "https://panel.pengikut.id/api/order.php");
356 curl_setopt($ch, CURLOPT_POST, 1);
357 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
358 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
359 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
360 $chresult = curl_exec($ch);
361 curl_close($ch);
362 $json_result = json_decode($chresult, true);
363
364
365 $order_id = $json_result['id'];
366 $statusorder = "Pending";
367
368 /*
369 $ch = curl_init('https://followers-gratis.com/api.php');
370
371 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
372 curl_setopt($ch, CURLOPT_POST, 1);
373 curl_setopt($ch, CURLOPT_HEADER, 0);
374 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
375 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
376 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
377
378
379 curl_setopt($ch, CURLOPT_POST, true);
380 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
381
382
383 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
384 $results = curl_exec($ch);
385 if (curl_errno($ch)) {
386 $results = curl_error($ch);
387 }
388
389 curl_close($ch);
390
391 $order = json_encode($results);
392 $ambil= json_decode($results,true);
393
394 $order_id=$ambil['info']['order']['order_id'];
395 $statusorder = $ambil['info']['order']['status'];
396 */
397 }else if($id == 2){
398 $ch = curl_init('https://mentalispanel.id/api/json.php');
399
400 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
401 curl_setopt($ch, CURLOPT_POST, 1);
402 curl_setopt($ch, CURLOPT_HEADER, 0);
403 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
404 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
405 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
406
407
408 curl_setopt($ch, CURLOPT_POST, true);
409 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
410
411
412 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
413 $results = curl_exec($ch);
414 if (curl_errno($ch)) {
415 $results = curl_error($ch);
416 }
417
418 curl_close($ch);
419
420 $order = json_encode($results);
421 $ambil= json_decode($results,true);
422
423 $order_id=$ambil['data']['id'];
424 $statusorder = 'Pending';
425 }else if($id == 4){
426 $ch = curl_init('https://bulkfollows.com/api/v2');
427
428 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
429 curl_setopt($ch, CURLOPT_POST, 1);
430 curl_setopt($ch, CURLOPT_HEADER, 0);
431 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
432 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
433 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
434
435
436 curl_setopt($ch, CURLOPT_POST, true);
437 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
438
439
440 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
441 $results = curl_exec($ch);
442 if (curl_errno($ch)) {
443 $results = curl_error($ch);
444 }
445
446 curl_close($ch);
447
448 $order = json_encode($results);
449 $ambil= json_decode($results,true);
450
451
452 $order_id=$ambil['order'];
453 $statusorder = 'Pending';
454 }else{
455 $ch = curl_init();
456 curl_setopt($ch, CURLOPT_URL, "http://smmlite.com/api/v2");
457 curl_setopt($ch, CURLOPT_POST, 1);
458 curl_setopt($ch, CURLOPT_POSTFIELDS, $order_postdata);
459 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
460 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
461 $chresult = curl_exec($ch);
462 curl_close($ch);
463 $order_data = json_decode($chresult, true);
464
465 $order_id = $order_data['order'];
466 $statusorder = 'Pending';
467
468
469 }
470 // else{
471 // $result = $this->curl('http://curl.pengikut.id/ivlike2.php','urlxx='.request()->url.'&jumlahlahx='.request()->jumlah);
472 // }
473
474 // DELAY
475 if($id == 1 || $id == 2 || $id == 4){
476 if(isset($order_id)){
477 if(request()->jumlah > $max){
478 \App\Delay::where('user_id', auth()->user()->id)->update([$jeda => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . 24 . ' hour'))]);
479 return back();
480 }
481
482 \App\Delay::where('user_id', auth()->user()->id)->update([$jeda => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . $dcode))]);
483 $pesan = "SUKSES";
484
485 // SUB SERVER DB
486 $user_id = auth()->user()->id;
487 $cek = DB::table('subserver')->where('user_id', $user_id)->where('date', date('Y-m-d'))->get();
488 $data = DB::table('subserver')->where('user_id', $user_id)->where('date', date('Y-m-d'))->first();
489 if(count($cek) == 0){
490 if($id == 1){
491 $ins = DB::table('subserver')
492 ->insert([
493 'user_id' => $user_id,
494 'server1' => 1,
495 'server2' => 0,
496 'date' => date('Y-m-d')
497 ]);
498 }else{
499 $ins = DB::table('subserver')
500 ->insert([
501 'user_id' => $user_id,
502 'server1' => 0,
503 'server2' => 1,
504 'date' => date('Y-m-d')
505 ]);
506 }
507 }else{
508 if($id == 1){
509 $ins = DB::table('subserver')
510 ->where('user_id', $user_id)
511 ->where('date', date('Y-m-d'))
512 ->update([
513 'server1' => $data->server1 + 1,
514 ]);
515 }else{
516 $ins = DB::table('subserver')
517 ->where('user_id', $user_id)
518 ->where('date', date('Y-m-d'))
519 ->update([
520 'server2' => $data->server2 + 1,
521 ]);
522 }
523 }
524
525 $ins = DB::table('cekhistory')
526 ->insert([
527 'o_id' => $order_id,
528 'target' => $url,
529 'status' => $statusorder,
530 ]);
531
532
533
534 $history = new \App\History;
535 $history->submitted_by = auth()->user()->username;
536 $history->target = request()->url;
537 $history->type = $type;
538
539
540 $history->total_submit = request()->jumlah;
541 $history->status = $statusorder;
542 $history->order_id = $order_id;
543 $history->start = $ses_data['start'];
544
545 $history->ip = $_SERVER['REMOTE_ADDR'];
546 $history->save();
547 }else{
548 $pesan = 'GAGAL';
549 }
550 }else{
551 if(request()->jumlah > $max){
552 \App\Delay::where('user_id', auth()->user()->id)->update([$jeda => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . 24 . ' hour'))]);
553 return back();
554 }
555
556 \App\Delay::where('user_id', auth()->user()->id)->update([$jeda => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . $dcode))]);
557 $pesan = "SUKSES";
558
559 $history = new \App\History;
560 $history->submitted_by = auth()->user()->username;
561 $history->target = request()->url;
562 $history->type = $type;
563
564
565 $history->total_submit = request()->jumlah;
566 $history->status = $statusorder;
567 $history->order_id = $order_id;
568 $history->start = $ses_data['start'];
569
570 $history->ip = $_SERVER['REMOTE_ADDR'];
571 $history->save();
572 }
573 }
574
575 // if($id == 3){
576
577 // $cek = \App\History::where('submitted_by', \Auth::User()->username)
578 // ->where('type', 'Like Server 3')
579 // ->whereDate('created_at', '=', date('Y-m-d'))->sum('total_submit');
580
581 // if(request()->jumlah >= 2000){
582 // \App\Delay::where('user_id', auth()->user()->id)->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . 24 . ' hour'))]);
583 // return back();
584 // }
585
586 // if($cek <= 2000){
587
588 // $post_link = request()->url;
589 // $post_quantity = request()->jumlah;
590 // $order_postdata = "key=53155f07429d66115dd199a5fda0769c&action=add&service=450&link=$post_link&quantity=$post_quantity";
591 // $ch = curl_init();
592 // curl_setopt($ch, CURLOPT_URL, 'https://justanotherpanel.com/api/v2');
593 // curl_setopt($ch, CURLOPT_POST, 1);
594 // curl_setopt($ch, CURLOPT_POSTFIELDS, $order_postdata);
595 // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
596 // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
597 // $chresult = curl_exec($ch);
598 // curl_close($ch);
599 // $order_data = json_decode($chresult, true);
600
601 // $poid = $order_data['order'];
602
603 // $history = new \App\History;
604 // $history->submitted_by = auth()->user()->username;
605 // $history->target = request()->url;
606 // $history->type = 'Like Server 3';
607 // $history->total_submit = request()->jumlah;
608 // $history->start = $ses_data['start'];
609
610 // $history->ip = $_SERVER['REMOTE_ADDR'];
611 // $history->save();
612
613 // $cek = \App\History::where('submitted_by', \Auth::User()->username)
614 // ->where('type', 'Like Server 3')
615 // ->whereDate('created_at', '=', date('Y-m-d'))->sum('total_submit');
616
617 // if($cek >= 2000){
618 // \App\Delay::where('user_id', auth()->user()->id)->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . 24 . ' hour'))]);
619 // }
620
621 // $pesan = 'SUKSES';
622 // }else{
623 // $pesan = 'LIMIT';
624 // }
625 // }
626
627
628
629
630
631 session()->flash('result', $pesan);
632
633 return redirect('service/like/'.$id);
634
635 }
636 public function curlLikes($postdata, $api)
637 {
638 $ch = curl_init($api);
639
640 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
641 curl_setopt($ch, CURLOPT_POST, 1);
642 curl_setopt($ch, CURLOPT_HEADER, 0);
643 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
644 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
645 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
646
647
648 curl_setopt($ch, CURLOPT_POST, true);
649 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
650
651
652 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
653 $result = curl_exec($ch);
654 if (curl_errno($ch)) {
655 $result = curl_error($ch);
656 }
657
658 curl_close($ch);
659
660 }
661
662 public function curl($url, $postdata = ''){
663 $ch = curl_init();
664 curl_setopt($ch, CURLOPT_URL, $url);
665 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
666
667 curl_setopt($ch, CURLOPT_POST, true);
668 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
669
670 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
671 curl_setopt($ch, CURLOPT_TIMEOUT,10);
672 $result = curl_exec($ch);
673 curl_close($ch);
674 return $result;
675 }
676
677 public function ubai($postdata){
678
679
680 $ch = curl_init('https://followers-gratis.com/api.php');
681
682 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
683 curl_setopt($ch, CURLOPT_POST, 1);
684 curl_setopt($ch, CURLOPT_HEADER, 0);
685 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
686 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
687 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
688
689
690 curl_setopt($ch, CURLOPT_POST, true);
691 curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
692
693
694 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
695 $results = curl_exec($ch);
696 if (curl_errno($ch)) {
697 $results = curl_error($ch);
698 }
699
700 curl_close($ch);
701
702 }
703
704 function proses($url,$params,$username,$password){
705
706 $ch = curl_init();
707 curl_setopt($ch, CURLOPT_POST, 1);
708 curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$username&password=$password");
709 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
710 curl_setopt($ch, CURLOPT_COOKIEJAR, "-");
711 curl_setopt($ch, CURLOPT_COOKIEFILE, "-");
712 $result = curl_exec($ch);
713 curl_setopt($ch, CURLOPT_URL, $url);
714 curl_setopt($ch, CURLOPT_POST, 1);
715 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
716 $result = curl_exec($ch);
717 curl_close($ch);
718 }
719
720}