Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hostname = "sqlsrv:Server=10.0.0.6;Database=CRM";
- $username = "IVIO";
- $password = "CoconutPuppy!01";
- // Start up NetExtender if it isn't curently running
- if (!ping('10.0.0.6')) {
- exec("echo 'y' | netExtender -u Andrew -p Ent3502# -d entrenue.local 184.188.110.18:4433 > out.text &");
- // Wait until the SSL-VPN is working.
- while(!ping('10.0.0.6')){echo '.';}
- }
- $pdo = new PDO($hostname, $username, $password);
- $query = "SELECT TOP 10 Addr_Street FROM CRM.dbo.vAddress";
- $result = $pdo->query($query);
- print_r($result->fetchColumn());
- function ping($host, $port=80, $timeout=1) {
- $fp = fsockopen($host,$port,$errCode,$errStr,$timeout);
- $ret = intval($fp);
- if ($fp) {
- fclose($fp);
- }
- return $ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement