Parašė rokasbalsys· 2014 Kov. 25 18:03:43
#1
Nezinau net kaip cia pasakyti, taciau yra problema,
mysql database turiu susikures useri, ta prasme acc, taciau man jo vistiek neranda, kai prisijungiu raso 'We can\'t find that username. Have you registered?'
Cia login.php kodas
<?php
include 'core/init.php';
if (user_exists('rokas') === true); {
echo 'exists';
}
if (empty($_POST) === false) {
$username = $_POST['username'];
$password = $_POST['password'];
if (empty($username) === true || empty($password) === true) {
$errors[] = 'You need to enter a username and password';
} else if (user_exists($username) === false) {
$errors[] = 'We can\'t find that username. Have you registered?';
}
else if (user_active($username) === false) {
$errors[] = 'You haven\'t activated your account!';
}
else {
}
print_r($errors);
}
?>
O cia users.php kodas kur parinkti turi man useri
<?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;
}
http://86.100.71.91/IR/ cia dabar darau svetaine
jungtis galite meginti su username:rokas psw:rokas
toki esu sukures.
Dar esu gan zalias
php koduose, dariau pagal sita tutoriala:
https://www.youtube.com/watch?v=...
Redagavo rokasbalsys· 2014 Kov. 25 18:03:40