<?php { $login=$_POST['login']; } { $haslo=$_POST['haslo']; } { if ($login == $ex[0] && $haslo == $ex[1]) { } { } } ?>
Formularz wyglada tak:
Kod
<html>
<head>
<title>Test formularza</title>
</head>
<body>
<form action="http://localhost/~my/index.php" method="POST">
Login: <input type=text name="login"/><br/>
Hasło: <input type=text name="haslo"/><br/>
<input type=submit value="Wyślij"/>
</form>
</body>
</html>
<head>
<title>Test formularza</title>
</head>
<body>
<form action="http://localhost/~my/index.php" method="POST">
Login: <input type=text name="login"/><br/>
Hasło: <input type=text name="haslo"/><br/>
<input type=submit value="Wyślij"/>
</form>
</body>
</html>
A plik passy.txt tak:
Kod
admin##admin
test1##test1
test2##test
test1##test1
test2##test
I co bym nie wpisywał w formularzu to i tak zawsze wyswietla:
"Zły login lub/i hasło"
Ma ktos jakis pomysł
