I am trying to pass a form variable to phpseclib ssh as a hostname. Something like this:
<form action="test.php" method="post">
IP OR HOSTNAME: <input type="text" name="ipaddr">
<?php
$ipaddr = $_POST["ipaddr"];
$ssh = new ssh2('$ipaddr');
if (!$ssh->login('username', 'password')) {
exit('Login Failed');
}
echo $ssh->exec('command1');
echo $ssh->exec('command2');
?>
Doesn't appear to be working. What am I missing?