Public paste
test..2
By: PnE | Date: Oct 8 2008 20:28 | Format: PHP | Expires: never | Size: 637 B | Hits: 1234

  1. <?php
  2. $a=$_POST["a"];
  3. $ch = curl_init() or die(curl_error());
  4. $params="a=$a";
  5. curl_setopt($ch, CURLOPT_POST,1);
  6. curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
  7. curl_setopt($ch, CURLOPT_URL,"http://lan:85/cgi-bin/video.jpg?size=3");
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  10. curl_setopt($ch, CURLOPT_USERPWD, 'demo:'); // IF required
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
  13. $data1=curl_exec($ch) or die(curl_error());
  14. header("Content-type: image/jpeg");
  15. imagejpeg($data1, null);
  16. echo curl_error($ch);
  17. ?>