Quantcast
Channel: Сообщество PHP DevelStudio - среда разработки программ
Viewing all articles
Browse latest Browse all 6336

Система авторизации с база данных | Login System with database

$
0
0
Скрипт для компонента входа (кнопки):

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==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 или свой расширение (например "database.myprogname" , "database.data") или же файл без расширения (например просто "database")

Но, создавайте базу данных в txt и потом измените расширение

Логини и пароли кладите в базу данных таким видом

Код:

(Логини отдельно в строке) Edd, Otherlogin, Noob
(Пароли отдельно) Password, Parol, Nab

или делайте это как хотите но отдельно.

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

Код:

(Logins need to be separated) Edd, Otherlogin, Noob
(Passwords too) Password, Parol, Nab

Or separate them with your way


Viewing all articles
Browse latest Browse all 6336

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>