PHP Echo Alert JS

echo '<script type="text/javascript">alert("Data has been submitted to ' . $to . '");</script>';
Kind Kea