I don't understand why does it display this message: "Parse error: parse error in C:\wamp\www\aaa\tftp scripts\testTFTP_r3.php on line 45"
each time I tried to execute the php scripts as below:
<?
//telnet
require_once "PHPTelnet_config.php";
$telnet = new PHPTelnet();
$result = $telnet->Connect('192.168.100.30','','');
if ($result == 0) {
//echo $username1;
$telnet->DoCommand($username1, $result);
// NOTE: $result may contain newlines
//echo $result;
$telnet->DoCommand($password1, $result);
// NOTE: $result may contain newlines
//echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
//$telnet->Disconnect();
$telnet->DoCommand("super", $result);
$telnet->DoCommand("super", $result);
$telnet->DoCommand("enable", $result);
$telnet->DoCommand("cisco", $result);
$telnet->DoCommand("copy tftp startup-config", $result);
$telnet->DoCommand("192.168.100.99", $result);
}
//here is the command to specify which lab
switch(3){
case 1:
$telnet->DoCommand("R3_lab1_Config", $result);
break;
case 2:
$telnet->DoCommand("R3_lab2_Config_PPP", $result);
break;
case 3:
$telnet->DoCommand("R3_lab3_Config_SSH_NTP_Syslog", $result);
break;
default :
echo "something went wrong with the selections" ;
break;
}
?>
Please assist. Thank you in advance
Try removing break statement that is in the default alternative.