Advertisement
Guest User

Untitled

a guest
Jan 28th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2. include("config.php");
  3. include ("database.php");
  4. session_start();
  5.  
  6. ?>
  7.  
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  12. <title><?php $title ?></title>
  13. </head>
  14. <body>
  15.  
  16. <form action="register.php" method="post">
  17. <p>Benutzername:<br/>
  18. <input name="username" type="text" maxlength="20"></p>
  19.  
  20. <p>E-Mail:<br/>
  21. <input name="mail" type="text"></p>
  22.  
  23. <p>Passwort:<br/>
  24. <input name="passwort" type="password"></p>
  25. <p>Passwort wiederholden: <br/>
  26. <input name="passwort2" type="password"></p>
  27. <p>
  28. <input name="submit" type="submit" value="Registrieren"></p>
  29.  
  30. </form>
  31.  
  32. </body>
  33. </html>
  34.  
  35.  
  36.  
  37.  
  38. <?php
  39.  
  40.  
  41.  
  42. if(isset($_POST['submit']))
  43.  
  44. {
  45.  
  46. if(empty($_POST['username']) or empty($_POST['mail']) or empty($_POST['passwort']) or empty($_POST['passwort2']))
  47. {
  48.     echo '<script type="text/javascript">;alert("Bitte alle Felder ausfüllen!")</script>';
  49. }
  50.  
  51. else
  52.  
  53. {
  54.  
  55. $username = $_POST['username'];
  56. $passwort = $_POST['passwort'];
  57. $passwort2 = $_POST['passwort2'];
  58. $mail = $_POST['mail'];
  59.  
  60.  
  61. $mysqladduser = mysql_query("INSERT INTO users(username, passwort, mail,ip) VALUES ('$username' , '$passwort' , '$mail', '$ip')");
  62. header ("Location: ".$pfad."erfolg.php");}
  63.  
  64. }
  65.  
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement