I am using the below to sent ssh commands through a web interface. For example, to get the hostname of a Linux computer:
index.html
[code]
Select Client
Client001
Client002
Client003
hostname.php
[php]<?php
include(‘Net/SSH2.php’);
include(‘variables.php’);
$ip = $_GET[‘clients’];
$ssh = new Net_SSH2(’$ip’);
if (!$ssh->login($user, $pass)) {exit(‘Login Failed’);}
echo $ssh->exec(‘hostname’);
?>[/php]
In hostname.php if I set the $ip variable manually, everything works as expected. But when I use
[php]$ip = $_GET[‘clients’];[/php]
I get a message saying “Login Failed”
When I echo $ip I correctly get the IP Address of the dropdown selection.
What I’m I doing wrong here?
Thanks