The below alert popup is displayed in case of error and user should stay on the same page in order to modify the content of field. So the task is to have a popup message that when closed, let the user on the same page without reloading it and showing him the values put in the fields.
....
else{
echo "
<script type='text/javascript'>
alert ('Error Message.'); return false;
</script>
";}
I put the 'return false' in order to avoid to redirect but it doesn'work.