Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $user["adm"] = "adm";
- if (!isset($_SESSION['logged_in']))
- {
- if ($_SERVER['REQUEST_METHOD'] == 'POST')
- {
- if (empty($_POST['username']) || empty($_POST['password']))
- {
- echo '<center><span style="color:red; font-weight: bold">Please fill in all fields!</span></center>';
- }
- elseif ($user[$_POST['username']] != $_POST['password'])
- {
- echo '<span style="color:red; font-weight: bold">Your username/password is wrong!</span>';
- }
- else
- {
- $_SESSION['ingelogd'] = true;
- echo '<span style="color:green; font-weight: bold">You are now logged in!</span>';
- }
- }
- }
- if (isset($_SESSION['ingelogd'])) {
- ?> <br /><br />
- <html>
- <head>
- <title> RAHASIA NEGARA </title>
- </head>
- <body>
- <?php
- if(isset($_GET['fikri']) == 'tamvans'){
- @session_start();
- @session_destroy();
- header("location:tes-baru.php");
- }
- ?>
- Welcome , <span style="color:blue; font-weight: bold"><?php echo $user["adm"] ?> </span> | <a href='?fikri=tamvans'>Mau Logout ?</a><br/><br/>
- Ini Hanya contoh , Daftar Pengguna / Siswa :<br />
- - Nama Siswa (KELAS)<br />
- - Nama Siswa (KELAS)<br />
- </body>
- </html>
- <?php
- }
- else
- {
- exit('<title>Login Dulu Pea</title><center>You need to log-in to view this page.<br /><br />
- <form method="POST" action=""><p>
- Username:<br />
- <input required type="text" name="username" /><br /><br />
- Password:<br />
- <input required type="password" name="password" /><br /><br />
- <input type="submit" value="Login" /> <input type="reset" value="Empty fields" />
- </form></center>');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement