Скрипт для компонента входа (кнопки):
База данных может быть обычный txt или свой расширение (например "database.myprogname" , "database.data") или же файл без расширения (например просто "database")
Но, создавайте базу данных в txt и потом измените расширение
Логини и пароли кладите в базу данных таким видом
Database can be just a txt file or with your own extension (ex. "database.data") or without it (ex. "database")
But create your database at first with txt, then change extension.
Put logins and passwords to database like this
PHP код:
$login = 0; //Login is in neutral right now
$pass = 0; //Password too
$file = file_get_contents('database.txt');//Getting logins from database
$text = c("edit1")->text; //Component of login
$haystack = $file; //File for search
$needle = $text; //What to search in file
$pos = strripos($haystack, $needle); //Searching
if ($pos === false) { //If nothing find
$login = 0; //Login will stay neutral
} else { //But if find what searched
$login = 1; //Login will be ready
}
$file1 = file_get_contents('database.txt'); //Getting passwords from database
$text1 = c("edit2")->text; //Component of password
$haystack1 = $file1; //File for search
$needle1 = $text1; //What to search
$pos1 = strripos($haystack1, $needle1); //Searching
if ($pos1 === false) { //If nothing find
$pass = 0; //Password will stay neutral
} else { //But if find what searched
$pass = 1; //Password will be ready too
}
if($login==1 and $pass==1){ //And at leats if login and password is ready, then
echo(Yooo); //Successfully Logged in
}else{ //If login or password is neutral, then
echo(Error); //Wrong username or password
}
Но, создавайте базу данных в txt и потом измените расширение
Логини и пароли кладите в базу данных таким видом
Код:
(Логини отдельно в строке) Edd, Otherlogin, Noob
(Пароли отдельно) Password, Parol, Nab
или делайте это как хотите но отдельно.
But create your database at first with txt, then change extension.
Put logins and passwords to database like this
Код:
(Logins need to be separated) Edd, Otherlogin, Noob
(Passwords too) Password, Parol, Nab
Or separate them with your way