PHP表单在提交后消失

I am trying to see how I can get the page to confirm that it has been filled in.

this is what I have got.

<?php
if(!isset($_POST['submit']))
{echo
        '<form action="" method="post">
            <input type="text" placeholder="From" name="from"><br>
            <input type="text" placeholder="Subject" name="sub"><br>
            <input type="text" placeholder="Message"name="mess"><br>
            <input type="submit">
        </form>';}
else{
$to = 'test@test.com, '. $from=$_POST['from'];
$subject = $_POST['sub'];
$message = $_POST['mess'];

mail ( $to , $subject , $message);
    echo 'thanks for submitting!<br>';}

?>

Replace Following code:

mail ( $to , $subject , $message);
    echo 'thanks for submitting!<br>';

By this:

if(@mail($to, $subject, $message)) {
  echo "thanks for submitting";
}else{
  echo "Unable to submit your email.";
}

For more info : http://php.net/manual/en/function.mail.php
Good luck!