Advertisement
TheStuntman

Untitled

Jan 30th, 2015
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <?php
  2.  
  3. $whmcsurl = "https://www.whmcs.com/index.php";
  4. $postfields = array("curltest"=>"1");
  5.  
  6. $ip = gethostbyname('licensing28.whmcs.com');
  7.  
  8. echo "<font style=\"font-size:18px;\">Testing Connection to '$whmcsurl'...<br />URL resolves to $ip<br /><br />";
  9.  
  10. if ($ip!="184.94.192.3" && $ip!="208.74.120.227") echo "<font style=\"color:#cc0000;\">Error: The IP whmcs.com is resolving to the wrong IP. Someone on your server is trying to bypass licensing. You'll need your host to investigate and fix.</font><br /><br />";
  11.  
  12. $ch = curl_init();
  13. curl_setopt($ch, CURLOPT_URL, $whmcsurl);
  14. curl_setopt($ch, CURLOPT_POST, 1);
  15. curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
  16. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18. $data = curl_exec($ch);
  19.  
  20. if (curl_error($ch)) {
  21. echo "Curl Error: ".curl_error($ch)."<br /><br />";
  22. } elseif (!$data) {
  23. echo "Empty Data Response - Please check CURL Installation<br /><br />";
  24. }
  25.  
  26. curl_close($ch);
  27.  
  28. echo "Connection Response (this should be the HTML from $whmcsurl when working correctly):<br /><br /><textarea rows=\"20\" cols=\"120\">$data</textarea>";
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement