servervars.php 999 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. ?>