Answer the question
In order to leave comments, you need to log in
403 php error, what to do?
When creating the simplest form login, password with the base It
gives errors, I can’t figure out what to do
Code:
<?php
require "dp.php";
$data = $_POST;
if( isset($data['do_login']))
{
// code...
//baza
$errors = array();
if( trim($data[' login ']) == '' )
{
$erros[] = 'Ведите логин!';
}
}
if( trim($data[' password ']) == '' )
{
$erros[] = 'Ведите пароль!!';
}
if( empty($errors))
{
//все ок
}else {
echo '<div style="color: red;">' .array_shift($erros). '</div><hr>';
}
?>
<?php
?>
<meta charset="utf-8">
<form action="login.php>" method="POST">
<p>
<p><strong>Ваш логин:</strong></p>
<input type="text" name="login">
</p>
<p>
<p><strong>Ваш пароль</strong>:</p>
<input type="password" name="password">
</p>
<p>
<button type="submit" name="do_login">Войти</button>
</p>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question