Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:


require_once "PHPTelnet_config.php";

$telnet = new PHPTelnet();

$result = $telnet->Connect('','','');

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->DoCommand("super", $result);
    $telnet->DoCommand("super", $result);
    $telnet->DoCommand("enable", $result);
    $telnet->DoCommand("cisco", $result);
    $telnet->DoCommand("copy tftp startup-config", $result);
    $telnet->DoCommand("", $result);
    //here is the command to specify which lab

        case 1:
            $telnet->DoCommand("R3_lab1_Config", $result);

        case 2:
            $telnet->DoCommand("R3_lab2_Config_PPP", $result);

        case 3:
            $telnet->DoCommand("R3_lab3_Config_SSH_NTP_Syslog", $result);
        default :
            echo "something went wrong with the selections" ;

Please assist. Thank you in advance

share|improve this question
This is probably a better fit for SO. –  Joshua Enfield Dec 13 '10 at 4:06

1 Answer 1

Try removing break statement that is in the default alternative.

share|improve this answer
+1 - You dont need to break using the default when using a switch. Simply end the statement using your } –  JamesK Dec 13 '10 at 9:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.