SHARE
TWEET

Untitled

a guest Jul 17th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $name = $_POST['name'];
  4. $password = $_POST['password'];
  5.  
  6.  
  7.  
  8. //echo "$name";
  9. //echo "$password";
  10.  
  11. if (isset($_POST["login"])){
  12.  
  13. if ($password !== "") {
  14.     //Dozent
  15.  
  16.     //Abfrage ob Daten in Datenbank existieren
  17.  
  18.   //  header ( 'Location: dozent.php' );
  19.  
  20.     echo("Angemeldet als Dozent");
  21.  
  22. }
  23. else{
  24.     header ( 'Location: student.php' );
  25.     //Student
  26.  
  27.     echo("Angemeldet als Student");
  28. }
  29. }
  30.  
  31. if (isset($_POST['register'])) {
  32.     if ($password !== "") {
  33.  
  34.     $con = mysqli_connect('localhost','root','');
  35.  
  36.     mysqli_select_db($con,'bewertungsumfrage');
  37.  
  38.     mysqli_query($con,"INSERT INTO anwender (benutzername,kennwort) VALUES ('$name','$password')");
  39.  
  40.  
  41.     echo("Als Dozent registriert");
  42.  
  43. }
  44. else
  45. {
  46.     echo "Passwortfeld darf nicht leer sein!";
  47. }
  48. }
  49. ?>
  50.  
  51. <html>
  52. <head>
  53. </head>
  54. <body>
  55.  
  56. </body>
  57.  
  58. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top