Hi there,

I am new to php. I would like to make a website that can make telnet connection. Connecting to the terminal server and login to the selected networking device. I saw this script (requires the other file as well) in a website for making telnet connection but i do not know what to put at the 'DoCommand' part so i only put 'enable'. When i load the page, i see 'enable Password: Password: '. How do i put the password in so that it will go be able to do the 'sh run' command? Anyone familiar with telnet connection?

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<?php
require_once "PHPTelnet.php";
$telnet = new PHPTelnet();
$telnet->show_connect_error=0;
// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result $telnet->Connect('172.16.221.210','cisco','class'); //wwww.somewhere.com, username, password
switch ($result) {
case 
0
$telnet->DoCommand('enable'$result);
// NOTE: $result may contain newlines
echo $result;
$telnet->DoCommand('sh run'$result);
echo 
$result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
break; 
case 
1:
echo 
'[PHP Telnet] Connect failed: Unable to open network connection';
break; 
case 
2:
echo 
'[PHP Telnet] Connect failed: Unknown host';
break; 
case 
3:
echo 
'[PHP Telnet] Connect failed: Login failed';
break; 
case 
4:
echo 
'[PHP Telnet] Connect failed: Your PHP version does not support PHP Telnet';
break; 
}
?> 
</body>
</html>