Advertisement
Guest User

Untitled

a guest
Nov 29th, 2018
111
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.  
  9. <?php
  10. include '../navbar.php';
  11. ?>
  12.  
  13. <h1> Vennligst logg inn</h1>
  14.  
  15. <form method="get">
  16. Username:<br>
  17. <input type="text" name="usr"><br>
  18. Password:<br>
  19. <input type="password" name="pswd"><br><br>
  20. <input type="submit" name="submit" value="Submit">
  21. </form>
  22.  
  23.  
  24. <?php
  25.  
  26. $fh=fopen("/var/www/html/gitte/oppgaver2/dnpswd.xml", "r") or die("Failed to open document");
  27.  
  28. while (!feof($fh)) {
  29.  
  30. $line=fgets($fh);
  31. $comma=strpos($line, ",");
  32. $user=substr($line, 0, $comma);
  33. $pswd=substr($line, ++$comma);
  34.  
  35. if (($_GET[usr]===$user) and ($_GET[pswd]===$pswd) {
  36. echo "Velkommen " . $_GET[usr] . ". Håper du får en fin dag!";
  37. }
  38.  
  39.  
  40. }
  41.  
  42. fclose($fh);
  43. ?>
  44.  
  45.  
  46. <?php
  47. include '../footer.php';
  48. ?>
  49.  
  50. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement