<?php
//http://localhost:90/logout.php?portal_ip=10.1.1.2&client_id=e0:91:53:32:6a:80&wbaredirect=http://www.thairath.com/&ssid=Wifi_Captive&bssid=00:26:3e:ba:fb:42
echo “Mac : “;
 echo $_GET[“client_id”];
// Using ssl
$ssh = ssh2_connect(‘10.1.1.2’,22);
ssh2_auth_password($ssh, ‘admin’, ‘juniper123’);
// exec a command and return a stream
$stream = ssh2_exec($ssh, ‘whoami’);
// force PHP to wait for the output
stream_set_blocking($stream, true);
// read the output into a variable
$data = ”;
while($buffer = fread($stream, 4096)) {
   $data .= $buffer;
}
// close the stream
fclose($stream);
// print the response
echo $data;
?>