0

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

1
  • 1
    This is probably a better fit for SO. Dec 13, 2010 at 4:06

1 Answer 1

1

Try removing break statement that is in the default alternative.

1
  • +1 - You dont need to break using the default when using a switch. Simply end the statement using your }
    – JamesK
    Dec 13, 2010 at 9:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .