Hi guys,
I’ve got problem with my new website. If I try login inside, the web answer me:
Array ( [0] => You need to enter a username and password )
The web show me only this error
Xampp is turn on, In phpadmin I got configuration:
- Web
- Users
this is code:
[php]<?php
$connect_error = ‘Error message, please wait we are back for seconds’;
$con = mysqli_connect(‘localhost’,‘root’,’’);
mysqli_select_db($con,‘test’) or die($connect_error);
?>[/php]
// init.php
[php]
<?php session_start(); error_reporting(0); require 'database/connect.php'; require 'functions/users.php'; require 'functions/general.php'; $errors = array(); ?>[/php]
// users.php
[php]
<?php function user_exists($username) { $username = sanitize($username); return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username'"),0) == 1)? true : false; } function user_active($username) { $username = sanitize($username); return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND 'active' = 1"), 0) == 1) ? true : false; } ?>[/php]
// users.php
[php]
[/php]
// general.php
[php]<?php
function sanitize ($data) {
return mysql_real_escape_string($data);
}
?>[/php]
Please help me… what I do wrong ?