tls-check.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. function curl_download($Url){
  3. // is cURL installed yet?
  4. if (!function_exists('curl_init')){
  5. die('Sorry cURL is not installed!');
  6. }
  7. // OK cool - then let's create a new cURL resource handle
  8. $ch = curl_init();
  9. // Now set some options (most are optional)
  10. // Set URL to download
  11. curl_setopt($ch, CURLOPT_URL, $Url);
  12. // Set a referer
  13. curl_setopt($ch, CURLOPT_REFERER, "http://www.example.org/yay.htm");
  14. // User agent
  15. curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
  16. curl_setopt($ch, CURLOPT_SSLVERSION, 6);
  17. // Include header in result? (0 = yes, 1 = no)
  18. curl_setopt($ch, CURLOPT_HEADER, 0);
  19. // Should cURL return or print out the data? (true = return, false = print)
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  21. // Timeout in seconds
  22. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  23. // Download the given URL, and return output
  24. $output = curl_exec($ch);
  25. // Close the cURL resource, and free system resources
  26. curl_close($ch);
  27. return $output;
  28. }
  29. print curl_download('https://tlstest.paypal.com/');