Вот код для простенькой регистрации на сайте:
<?php
$data = $_POST;
if (isset($data['do_signup']))
{
$errors = array();
if (trim($data['login']) == '' )
{
$errors[] = 'введите логин!';
}
if (trim($data['email']) == '' )
{
$errors[] = 'введите Email!';
}
if ($data['password'] == '' )
{
$errors[] = 'введите пароль!';
}
if (trim($data['password2']) != $data['password'] )
{
$errors[] = 'Пароли не совпадают!';
}
if (empty($errors)) {
echo '<div style="color:green;">Вы успешно зарегестрированы</div><hr>';
}else
{
echo '<div style="color:red;">'.array_shift($errors).'</div><hr>';
}
}
?>
<form action="/signup.php" method="POST" >
<p>
<input type="text" name="login" placeholder="Ващ логин" value="<?php echo @$data['login'];?>" >
</p>
<p>
<input type="email" name="email" placeholder="Ваша почта" value="<?php echo @$data['email'];?>" >
</p>
<p>
<input type="password" name="password" placeholder="Ваш пароль" value="<?php echo @$data['password'];?>" >
</p>
<p>
<input type="password" name="password2" placeholder="Ваш пароль еще раз " value="<?php echo @$data['password2'];?>" >
</p>
<p>
<button type="submit" name="do_signup">Зарегистрироваться</button>
</p>
</form>
При нажатии на кнопку "Зарегестрироваться",выдает ошибку :
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.33 (Win32) OpenSSL/1.1.0g PHP/7.2.4