Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Oppgave1</title>
- <link rel="stylesheet" type="text/css" href="oppgaver2.css">
- </head>
- <body>
- <?php
- include '../navbar.php';
- ?>
- <h1> Vennligst logg inn</h1>
- <form method="get">
- Username:<br>
- <input type="text" name="usr"><br>
- Password:<br>
- <input type="password" name="pswd"><br><br>
- <input type="submit" name="submit" value="Submit">
- </form>
- <?php
- $fh=fopen("/var/www/html/gitte/oppgaver2/dnpswd.xml", "r") or die("Failed to open document");
- while (!feof($fh)) {
- $line=fgets($fh);
- $comma=strpos($line, ",");
- $user=substr($line, 0, $comma);
- $pswd=substr($line, ++$comma);
- if (($_GET[usr]===$user) and ($_GET[pswd]===$pswd) {
- echo "Velkommen " . $_GET[usr] . ". Håper du får en fin dag!";
- }
- }
- fclose($fh);
- ?>
- <?php
- include '../footer.php';
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement