<body> <?php $message='Here is an alert message written by php'; echo '<script type="text/javascript">window.alert("'.$message.'");</script>'; ?> </body>