servervars.php 999 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. # Domain Name Variable
  3. $domainNameone = "adservices.net";
  4. $domainNametwo = "aadservicesftp.com";
  5. # Function
  6. function domainCheck($domainName, $attemptRequest=false)
  7. {
  8. $errorno = 0;
  9. $errorstr = "";
  10. $fp = @fsockopen ($domainName, 80, $errno, $errstr, 10);
  11. if (!$fp) {
  12. throw new Exception(sprintf("Failed to connect to host %s (%d): %s",
  13. $domainName, $errno, $errstr));
  14. } else {
  15. if ($attemptRequest) {
  16. $req = "GET / HTTP/1.1\r\n";
  17. $req .= "Host: {$domainName}\r\n";
  18. $req .= "Connection: Close\r\n\r\n";
  19. if (fwrite($fp, $req) == false) {
  20. throw new Exception("Failed to send data to {$domainName}");
  21. }
  22. }
  23. fclose($fp);
  24. }
  25. return true;
  26. }
  27. try {
  28. if (domainCheck($domainNameone)) {
  29. $serverone=$domainNameone;
  30. }
  31. } catch (Exception $e) {
  32. $serverone=$domainNametwo;
  33. }
  34. $guid="CCSG871414";
  35. $width="910px";
  36. ?>