public function login() { include("language/pl.php"); $this->login = $_POST['login']; $this->pyt = $this->pdo->prepare("SELECT * FROM users WHERE login=? AND haslo=?"); $_SESSION['login']=$this->login; $this->stmt=$lang[4]; } else { $this->stmt=$lang[5]; } } return $this->stmt; }
i wywolanie
<?php $login = new Klasa; ?> <form method="POST" action=""> <input type="text" name="login" value=""/> <input type="password" name="haslo" value=""/> <input type="submit" value="Zaloguj" name="spr"/> </form>
i komunikaty:
$lang[4]="Zostałeś zalogowany!"; $lang[5]="Podałeś niepoprawny login lub hasło!";
jednak coś jest nie tak, bo co bym nie wpisał to i tak zawsze wypisze "Zostałeś zalogowany!" co może być nie tak?