stuppid_bot

Untitled

Apr 19th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. $data = base64_decode($_POST['image']);
  4. $filename = 'img/temp/' . ($_SERVER['REQUEST_TIME'] + 54000) . '.png';
  5. file_put_contents($filename, $data);
  6. $url = 'http://' . $_SERVER['HTTP_HOST'] . preg_replace('#[^/]+$#', '', $_SERVER['SCRIPT_NAME']) . $filename;
  7.  
  8. $context = stream_context_create(array(
  9.     'http' => array(
  10.         'method' => 'POST',
  11.         'header'=> "Content-type: application/x-www-form-urlencoded\r\n",
  12.         'content' => 'photo=' . urlencode($url)
  13.     )
  14. ));
  15.  
  16. echo(file_get_contents($_POST['serverURL'], false, $context));
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment