how to popup alerts in html php code example
Example 1: alert in php
echo '<script>alert("Message")</script>';
Example 2: php pop up message
Copy Code<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Alert Box by PHP</title>
<?php
echo '<script type="text/javascript">';
echo ' alert("JavaScript Alert Box by PHP")'; //not showing an alert box.
echo '</script>';
?>
</head>
<body>
</body>
</html>