Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- class willysan{
- public $ip;
- public $key;
- public $validkey = "memekcyna";
- public $api = "https://domains.tntcode.com/ip/";
- public $worker1 = 0;
- public $worker2 = 0;
- public function revip(){
- $html =
- file_get_contents($this->api.$this->ip);
- $start = stripos($html, '<textarea cols="50" rows="10">');
- $end = stripos($html, '</textarea>', $offset = $start);
- $length = $end - $start;
- $htmlSection = substr($html, $start, $length);
- $result = str_replace('<textarea cols="50" rows="10">',"",$htmlSection);str_replace('</textarea>',"",$htmlSection);
- if($result != NULL){
- $this->worker1 = 1;
- return $result;
- }
- }
- public function apikey(){
- if($this->key != $this->validkey){
- return "Invalid Api Key";
- }else{
- $this->worker2 = 1;
- }
- }
- }
- class willy extends willysan {
- public function ip($ip){
- $this->ip = $ip;
- willy::revip();
- }
- public function key($key){
- $this->key = $key;
- willy::apikey();
- }
- public function validate(){
- $worker1 = $this->worker1;
- $worker2 = $this->worker2;
- if($worker1 == NULL){
- echo "Wrong Ip Format";die();
- }elseif($worker2 == NULL){
- echo willy::apikey();die();
- }elseif($worker1 != NULL && $worker2 != NULL){
- echo willy::revip();
- }else{
- echo "ngontol";
- }
- }
- }
- $willy = new willy();
- if(isset($_GET["ip"]) && isset($_GET["key"])){
- if(isset($_GET["key"])){if($_GET["key"] == NULL){echo "Please Enter ApiKey";die();}}
- $willy->ip($_GET["ip"]);
- $willy->key($_GET["key"]);
- $willy->validate();
- }else{
- if(isset($_GET["ip"])){if($_GET["ip"] == NULL){echo "Please Enter IP Address";die();}else{echo "Require key parameter";die();}}
- echo "Usage: ?ip=ipaddress&key=apikey";
- }
Add Comment
Please, Sign In to add comment