Advertisement
Guest User

[PHP] MaJyx Scanner PHP Proxy

a guest
Dec 8th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <?php
  2.     #########################################################################
  3.     #                       MaJyx Scanner PHP Proxy                         #
  4.     # Version:  1.0.0.0                                                     #
  5.     # Date:     08/12/02015                                                 #
  6.     # Creator:  HeavenSleep                                                 #
  7.     # Website:  http://www.majyx.net/                                       #
  8.     #########################################################################
  9.    
  10.    
  11.     if(isset($_FILES['file'])){
  12.         $file_name      = htmlentities(basename($_FILES['file']['name']));
  13.         $file_path      = $_FILES['file']['tmp_name'];
  14.  
  15.         $scan = scanFile($file_path);
  16.         echo($scan);
  17.     }
  18.  
  19.     function scanFile($file_path) {
  20.         $id='YourID';
  21.         $token='YourToken';
  22.  
  23.         $ch = curl_init();
  24.         curl_setopt($ch, CURLOPT_HEADER, 0);
  25.         curl_setopt($ch, CURLOPT_VERBOSE, 1);
  26.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27.         curl_setopt($ch, CURLOPT_URL, "http://v2.scan.majyx.net/scan.php?version=2");
  28.         curl_setopt($ch, CURLOPT_POST, true);
  29.         $post = array(
  30.             'token'=>$token,
  31.             'id'=>$id,
  32.             'file'=>'@'.$file_path,
  33.         );
  34.  
  35.         curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  36.  
  37.         $result = curl_exec($ch);
  38.         $err     = curl_errno($ch);
  39.         $errmsg  = curl_error($ch);
  40.  
  41.         if(!empty($err)){
  42.             $result = $errmsg;
  43.         }
  44.  
  45.         curl_close($ch);
  46.  
  47.         return $result;
  48.     }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement