Advertisement
Guest User

Untitled

a guest
Jul 5th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. $hostname = "sqlsrv:Server=10.0.0.6;Database=CRM";
  4. $username = "IVIO";
  5. $password = "CoconutPuppy!01";
  6.  
  7. // Start up NetExtender if it isn't curently running
  8. if (!ping('10.0.0.6')) {
  9. exec("echo 'y' | netExtender -u Andrew -p Ent3502# -d entrenue.local 184.188.110.18:4433 > out.text &");
  10. // Wait until the SSL-VPN is working.
  11. while(!ping('10.0.0.6')){echo '.';}
  12. }
  13.  
  14. $pdo = new PDO($hostname, $username, $password);
  15. $query = "SELECT TOP 10 Addr_Street FROM CRM.dbo.vAddress";
  16. $result = $pdo->query($query);
  17.  
  18. print_r($result->fetchColumn());
  19.  
  20. function ping($host, $port=80, $timeout=1) {
  21. $fp = fsockopen($host,$port,$errCode,$errStr,$timeout);
  22. $ret = intval($fp);
  23. if ($fp) {
  24. fclose($fp);
  25. }
  26. return $ret;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement