SHARE
TWEET

Untitled

a guest Jan 24th, 2020 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. c("label7")->caption = "Type Of The Proxy: -";
  2. c("label2")->caption = "IP: -";
  3. c("label3")->caption = "Provider: -"; //óñòàíàâëèâàåì íà ñëó÷àé îøèáêè ñòàíäàðòíûå çíà÷åíèÿ ïîñëå ïðåäûäóùåãî çàïðîñà
  4. c("label4")->caption = "Country: -";
  5. c("label5")->caption = "City: -";
  6. c("label6")->caption = "Uses Proxy: -";
  7. if(c("edit1")->text != Null){ //ïðîâåðÿåì, íàïèñàë ëè ÷òî-òî ïîëüçîâàòåëü â ïîëå äëÿ ââîäà, ÷òî-áû íå ñëàòü ïóñòîé çàïðîñ
  8.     //ðàáîòàåì ñ json äàííûìè
  9.     $ip = c("edit1")->text; //ïîëó÷àåì ââåäåíûå äàííûå
  10.     $curl = curl_init(); //çàïóñêàåì ñåàíñ curl
  11.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  12.     curl_setopt($curl, CURLOPT_URL, "https://proxycheck.io/v2/" . $ip . "?vpn=1&asn=1"); //çàäàåì url àäðåññ äëÿ îáðàùåíèÿ
  13.     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  14.     $data = curl_exec($curl); //îáðàùàåìñÿ, ÷èòàåì äàííûå è ñîõðàíÿåì â ïåðåìåííóþ.
  15.     curl_close($curl); //çàâåðøàåì ñåàíñ curl
  16.     $decoded = json_decode($data, true); //äåêîäèðóåì äàííûå èç json â ìàññèâ
  17.     if($decoded["status"] == "ok"){ //åñëè ñåðâèñ âåðíóë ñòàòóñ çàïðîñà OK, ìû ïîäñòàâëÿåì çíà÷åíèÿ
  18.         c("label2")->caption = "IP: " . $ip;
  19.         c("label3")->caption = "Provider: " . $decoded[$ip]["provider"];
  20.         c("label4")->caption = "Country: " . $decoded[$ip]["country"];
  21.         c("label5")->caption = "City: " . $decoded[$ip]["city"];
  22.         $proxy = $decoded[$ip]["proxy"]; //çàïèñûâàåì äëÿ óäîáñòâà ñòàòóñ ïðîêñè
  23.         if($proxy == "yes"){ //åñëè ïðîêñè åñòü, ìû çàïèñûâàåì çíà÷åíèå
  24.             c("label6")->caption = "Uses Proxy: Yes";
  25.             c("label7")->caption = "Type Of The Proxy: " . $decoded[$ip]["type"];
  26.         } else { //èíà÷å ïèøåì, ÷òî ïðîêñè íåò è òèï ïðîêñè îñòàâëÿåì ïðî÷åðêîì
  27.             c("label6")->caption = "Uses Proxy: No";
  28.         }
  29.     } elseif($decoded["status"] == "error") { //åñëè æå ñåðâèñ âåðíóë ñòàòóñ îøèáêè, âûâîäèì ñîîáùåíèå îá îøèáêå â îòäåëüíîå îêíî, äàííûå íå òðîãàåì
  30.         messageDlg($decoded["message"], mtError, MB_OK);
  31.     }
  32. } else { //åñëè æå ïîëüçîâàòåëü íè÷åãî íå íàïèñàë, âûâîäèì ñîîáùåíèå îá îøèáêå
  33.     messageDlg("Please, enter IP adress!", mtError, MB_OK);
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top