$pdo = new PDO('mysql:host=localhost;dbname=admin;charset=utf8', 'root', 'pass');
$pdo->exec('SET CHARACTER SET utf8');
$sql = "SELECT COUNT(username) AS num FROM bill_users WHERE username = :username";
$stmt = $pdo->prepare($sql);
$stmt->bindValue(':username', $post['username']);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if($row['num'] > 0) {
$sql = "SELECT * FROM bill_users WHERE username = :username";
$stmt = $pdo->prepare($sql);
$stmt->bindValue(':username', $post['username']);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if (password_verify($post['password'], $row['password'])) {
if ($row['is_activated'] == 1) {
$_SESSION['bill_auth'] = 'secretkey'; //yes
$_SESSION['user_id'] = $row['id'];
} else {
$info_text['error_1'] = 'Вы должны активировать свой аккаунт!';
}
} else {
$info_text['error_1'] = 'Данные не верны!';
}
} else {
$info_text['error_1'] = 'Пользователь не найден!';
}
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias *.mydomain.com
UseCanonicalName off
CustomLog /var/www/mydomain.com/custom_log.log vhost_combined
ErrorLog /var/www/mydomain.com/error_log.log
DocumentRoot /var/www/mydomain.com/public_html/
<Directory "/var/www/mydomain.com/public_html">
Options -Indexes +FollowSymLinks
Require all granted
AllowOverride All
</Directory>
AddDefaultCharset UTF-8
</VirtualHost>