🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #231368

Re: logowanie

#231368
From: Lemat
Date: Sun, 22 May 2016 18:54
27 lines
1520 bytes
W dniu 22.05.2016 o 20:14, platformowe głupki pisze:
> jak zrobić dobre logowanie dla wielu userów naraz?

<?PHP
session_start();

if (empty($_SESSION['identyfikator']) && !empty($_POST['login']) && 
!empty($_POST['haslo'])) {
	if (sprawdz_login_i_haslo_w_bazie_danych()) {
		$_SESSION['identyfikator']=identyfikator_usera;
		przekierowanie_na_strone_po_zalogowaniu();
		die();
		}
	else
		komunikat_o_blednym_hasle();
	}
	
if (empty($_SESSION['identyfikator'])) {
	wyświetl_formularz_logowania();
	}
else
	wyświetl_treść_dostępną_po_zalogowaniu();
?>

-- 
Pozdrawiam
Lemat
Technical Details
Message-ID: <5742000f$0$22844$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <nhssu2$ucq$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: logowanie
Newsgroups: pl.comp.lang.php
References: <nhssu2$ucq$1@node2.news.atman.pl>
From: Lemat <#@lemat.priv.pl>
Date: Sun, 22 May 2016 20:54:48 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
MIME-Version: 1.0
In-Reply-To: <nhssu2$ucq$1@node2.news.atman.pl>
Lines: 27
Message-ID: <5742000f$0$22844$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 79.189.200.118
X-Trace: 1463943183 unt-rea-a-02.news.neostrada.pl 22844 79.189.200.118:42497
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit