moar css & now with logout
This commit is contained in:
		@@ -26,6 +26,8 @@ if(isset($_GET['login'])) {
 | 
				
			|||||||
<!DOCTYPE html> 
 | 
					<!DOCTYPE html> 
 | 
				
			||||||
<html> 
 | 
					<html> 
 | 
				
			||||||
<head>
 | 
					<head>
 | 
				
			||||||
 | 
					<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
 | 
				
			||||||
 | 
					   
 | 
				
			||||||
  <title>Login</title>    
 | 
					  <title>Login</title>    
 | 
				
			||||||
</head> 
 | 
					</head> 
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
@@ -35,7 +37,7 @@ if(isset($errorMessage)) {
 | 
				
			|||||||
    echo $errorMessage;
 | 
					    echo $errorMessage;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
 
 | 
					 <script src="ressources/js/bootstrap.min.js"></script>
 | 
				
			||||||
<form action="?login=1" method="post">
 | 
					<form action="?login=1" method="post">
 | 
				
			||||||
Your Username:<br>
 | 
					Your Username:<br>
 | 
				
			||||||
<input type="text" size="40" maxlength="250" name="username"><br><br>
 | 
					<input type="text" size="40" maxlength="250" name="username"><br><br>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								logout.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								logout.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					<html>
 | 
				
			||||||
 | 
					<head>
 | 
				
			||||||
 | 
					<title>Logout</title>
 | 
				
			||||||
 | 
					<meta http-equiv="refresh" content="3; URL=login.php">
 | 
				
			||||||
 | 
					</head>
 | 
				
			||||||
 | 
					<body>
 | 
				
			||||||
 | 
					<?php
 | 
				
			||||||
 | 
					session_start();
 | 
				
			||||||
 | 
					session_destroy();
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					echo "Logout. Session is now destroyed. Now lets go to the login page.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					?>
 | 
				
			||||||
 | 
					</body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
@@ -1,3 +1,10 @@
 | 
				
			|||||||
 | 
					<html>
 | 
				
			||||||
 | 
					<head>
 | 
				
			||||||
 | 
					<title>Secure Page</title>
 | 
				
			||||||
 | 
					<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
 | 
				
			||||||
 | 
					</head>
 | 
				
			||||||
 | 
					<body>
 | 
				
			||||||
 | 
					<script src="ressources/js/bootstrap.min.js"></script>
 | 
				
			||||||
<?php
 | 
					<?php
 | 
				
			||||||
session_start();
 | 
					session_start();
 | 
				
			||||||
$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
 | 
					$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
 | 
				
			||||||
@@ -24,3 +31,5 @@ echo "This is the end now!";
 | 
				
			|||||||
echo "<br />";
 | 
					echo "<br />";
 | 
				
			||||||
echo "goodbye";
 | 
					echo "goodbye";
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
 | 
					</body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user