Advertisement
Guest User

Untitled

a guest
Nov 27th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Oppgave1</title>
  5. <link rel="stylesheet" type="text/css" href="oppgaver2.css">
  6. </head>
  7. <body>
  8. <?php
  9. include '../navbar.php';
  10. ?>
  11.  
  12.  
  13. <h1>Please Register a User</h1>
  14. <form method="post">
  15. Username:<br>
  16. <input type="text" name="usr"><br>
  17. Password:<br>
  18. <input type="password" name="pswd"><br>
  19. Confirm Password:<br>
  20. <input type="password" name="cpswd"><br><br>
  21. <input type="submit" name="submit" value="Submit">
  22. </form>
  23.  
  24. <?php
  25.  
  26.  
  27. if ($_POST[pswd]===$_POST[cpswd]){
  28. $fh=fopen("/var/www/html/gitte/oppgaver2/dnpswd.xml", "a") or die("Unable to open file!");
  29. $content= $_POST['usr'] . "," . $_POST['pswd'] . "\n";
  30.  
  31. fwrite($fh, $content);
  32. fclose($fh);
  33.  
  34. } else {
  35. echo "passordene var ikke lik, prøv på nytt!";
  36. }
  37.  
  38.  
  39.  
  40. ?>
  41.  
  42.  
  43.  
  44. <?php
  45. include '../footer.php';
  46. ?>
  47. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement