Return message status in page after send mail with php
<p>I try to show a message in html page, after send an e-mail.
I don't want to use javascript with an alert, just a simple message after send button.</p>

<p>I made a contact php page with this code:</p>

<pre><code>&lt;?php

$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_telefon = $_POST['cf_telefon'];
$field_message = $_POST['cf_message'];
$mail_to = 'diaconu.eduardstefan@gmail.com';;
$from = 'Mesaj nou de la:'.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Telefon: '.$field_telefon."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $from, $body_message, $headers);

 ?&gt;
</code></pre>

<p>And in html page, i insert a contact form with this code:</p>

<pre><code>       &lt;form  action="contact.php" method="post"&gt;
                        &lt;div class="form-group"&gt;
                            &lt;label for="name"&gt;
                                Nume
                            &lt;/label&gt;
                            &lt;input type="text" name="cf_name" placeholder="" id="name" class="form-control" required="true"&gt;
                        &lt;/div&gt;
                        &lt;div class="form-group"&gt;
                            &lt;label for="email"&gt;
                                Email
                            &lt;/label&gt;
                            &lt;input type="text" name="cf_email"  placeholder="" id="email" class="form-control" required="true"&gt;
                        &lt;/div&gt;
                        &lt;div class="form-group"&gt;
                            &lt;label for="phone"&gt;
                                Telefon
                            &lt;/label&gt;
                            &lt;input type="text" name="cf_telefon" id="phone" class="form-control"&gt;
                        &lt;/div&gt;
                        &lt;div class="form-group"&gt;
                            &lt;label for="phone"&gt;
                                Mesaj
                            &lt;/label&gt;
                            &lt;textarea name="cf_message" placeholder="" rows="5" class="form-control" required="true"&gt;
                            &lt;/textarea&gt;
                        &lt;/div&gt;

                        &lt;input class="btn btn-info" type="submit" value="Trimite" &gt;
&lt;?php if($send_mail) {
if($mail_status){
print "succes";
exit();
}
else {
print "eroare";
}
        }       
?&gt;
                    &lt;/form&gt;
</code></pre>

<p>Email was successfully sent, but the message isn't show. After press send button, contact form return a blank page. I want to return the same page with message. (ater refresh)</p>

<p>Maybe exist another way to do that? With get or something like that?</p>

<p>Thanks for help!</p>