this is called security issue. Cross site scripting, you have many methods to avoid it,
What's the best method for sanitizing user input with PHP?
For example if you have a option to input an email address you have to validate it like below:
If there is a option to enter a string then you ave to validate like below
In your case you have to do something like below
$Name = htmlentities($_POST['Name']);
$email = htmlentities($_POST['email']);
Instead of above, follow filter sanitizing method:
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$Name = trim(filter_var($_POST['Name'], FILTER_SANITIZE_STRING));