Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name = $_POST['name'];
- $password = $_POST['password'];
- //echo "$name";
- //echo "$password";
- if (isset($_POST["login"])){
- if ($password !== "") {
- //Dozent
- //Abfrage ob Daten in Datenbank existieren
- // header ( 'Location: dozent.php' );
- echo("Angemeldet als Dozent");
- }
- else{
- header ( 'Location: student.php' );
- //Student
- echo("Angemeldet als Student");
- }
- }
- if (isset($_POST['register'])) {
- if ($password !== "") {
- $con = mysqli_connect('localhost','root','');
- mysqli_select_db($con,'bewertungsumfrage');
- mysqli_query($con,"INSERT INTO anwender (benutzername,kennwort) VALUES ('$name','$password')");
- echo("Als Dozent registriert");
- }
- else
- {
- echo "Passwortfeld darf nicht leer sein!";
- }
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement