how to alert php variable in javascript code example
Example 1: php echo alert js
echo '<script type="text/javascript">alert("Data has been submitted to ' . $to . '");</script>';
Example 2: alert js in php
javascript:alert('Email enviado com Sucesso!');
javascript:window.location='index.php';