0

Parse error: syntax error, unexpected T_BREAK in C:\xampp\htdocs\website1\prompt.php on line 17

line 17 is in case 0 were it say break;

function createMessage($x)
{
    if(is_numeric($x))
    {
        switch($x)
        {
            case 0:
                $message = "Your account is now active. you may now <a href=\"login.php\">Log In!</a>"
                break;
            case 1:
                $message = "Thanks you for registering! A confirmation email has been sent to your email
                            Please click on the activation liink to ativate your account.";
                break;
            case 2:
                $message = "That email address or username has already been registered.";
                break;
            case 3:  //change?
                $message = "Sorry, but that item has already been traded";
                break;
            case 4:
                $message = "Item successfully updated!";
                break;
            case 5:
                $message = "Item successfully deleted";
                break;
            case 6:
                $message = "Message has been sent";
                break;
            case 7:
                $message = "Thank you for leaving feedback!";
                break;
            case 8:
                $message = "Item added successfully!";
                break;
            case 9:
                $message = "That is not your item";
                break;

            }
            echo $message;
    }
}
?>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by baig772
0

you have forgot semi-colon ';' after

 case 0:
 $message = "Your account is now active. you may now <a href=\"login.php\">Log In!</a>"

put the semi-colon and it will be fine

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.