why is <script>alert("Hello");</script> is inserted in php file code example
Example 1: alert in php
// This is in the PHP file and sends a Javascript alert to the client
$message = "Something";
echo "<script type='text/javascript'>alert('$message');</script>";
Example 2: allert in php
// This is in the PHP file and sends a Javascript alert to the client
$message = "wrong answer";
echo "<script type='text/javascript'>alert('$message');</script>";