you have a regular bracket instead of a curved bracket on PHP_SELF. and you're also using short tags, and you shouldn't be.
PHP Code:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
to check whether or not the form has been submitted, you should be checking the REQUEST_METHOD and not trying to see if $_POST['submit'] is set. this is also why you're getting a notice about an undefined index. do this instead:
PHP Code:
if($_SERVER['REQUEST_METHOD'] == "POST"){
//form was submitted
}else{
//form was not submitted
}