Popup in PHP after returning Success

1

I have a simple contact form and I would like the person to send the message, if it succeeds, a popup appears saying the message was sent.

How could I do this?

To help, I'll add part of the code PHP here:

 [..] 
 $header = implode("\r\n", $headers);
 if (mail($to, $subject, $message, $header)) {
 echo "concluido";
 }

 ?>
    
asked by anonymous 11.04.2016 / 16:36

1 answer

2

Elementary, my dear Watson:

 [..] 
 $header = implode("\r\n", $headers);
 if (mail($to, $subject, $message, $header)) {
            ?>
            <script language="JavaScript">
            <!--
            alert("Sucesso!");
            window.location = '/index.php';
            //-->
            </script>
            <?

 }

 ?>
    
11.04.2016 / 16:40