Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <h1>Logovanje</h1><br>
- <form method="GET" action="index.php">
- Username <input type="text" name="ime"><br>
- Password <input type="password" name="sifra"><br>
- Zapamti lozinku <input type="checkbox" name="sacuvaj"><br>
- <input type="submit" name="subm" value="Log in">
- </form>
- <?php
- if(isset($_GET['subm']))
- {
- $fajl= 'nalozi.xml';
- $xml= simplexml_load_file($fajl);
- foreach ($xml->user as $osoba)
- {
- if($osoba['aktivan']==1 && $osoba->username==$_GET['ime'] && $osoba->password==$_GET['sifra'])
- {
- setcookie('email', $_GET['ime'], time()+86400*3);
- if(isset($_GET['sacuvaj']))
- setcookie ('sifra', $_GET['sifra'], time()+86400*3);
- header("Location:uspesna.php");
- }
- }
- }
- else if(isset ($_COOKIE['email']))
- {
- $_GET['ime']=$_COOKIE['email'];
- if(isset($_COOKIE['sifra']))
- $_GET['sifra']=$_COOKIE['sifra'];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement