<?php
$message = "";
if (count($_POST)) {
// обрабатываем данные формы
// задаем значение переменной $message
}
?>
<?php if ($message) { ?>
<div id="error_message" style="width:200px; color:red; position:fixed; left:50%; margin-left:-100px; text-align:center;"></div>
<?php } else { ?>
<form action="" method="post" target="error_message">
<input name="reg_nickname" type="text" placeholder="Введите имя" required />
<input id="id_reg_email" name="reg_email" type="email" placeholder="Введите e-mail" required />
<input id="id_reg_pass" name="reg_pass" type="password" placeholder="Введите пароль" required />
<input id="id_reg_confirmpass" name="reg_confirmpass" type="password" placeholder="Подтвердите пароль" required />
<input type="submit" value="Зарегистрироваться" onclick="return check_email_pass();" style="margin-top:20px;" />
</form>
<?php } ?>
function isTouchDevice() {
return 'ontouchstart' in window // works on most browsers
|| navigator.maxTouchPoints; // works on IE10/11 and Surface
}