Loginpagina
This commit is contained in:
		
							
								
								
									
										35
									
								
								src/Application/Login.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/Application/Login.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  *  Informatica Eindproject D4p | ||||
|  *  6in3, Stedelijk Gymnasium Nijmegen | ||||
|  *  Docent: Hans de Wolf | ||||
|  * | ||||
|  *  ================== | ||||
|  * | ||||
|  *  Daniel Boutros, | ||||
|  *  Christiaan Goossens, | ||||
|  *  Jelmer Hinssen | ||||
|  */ | ||||
|  | ||||
| namespace InfD4p\Application; | ||||
|  | ||||
| use \Slim\App; | ||||
|  | ||||
| class Login { | ||||
|     public function __construct(App $app) { | ||||
|         $app->get('/login', function ($request, $response, $args) { | ||||
|             // Render index view | ||||
|             return $this->renderer->render($response, 'login.phtml', $args); | ||||
|         }); | ||||
| 		$app->post('/login', function ($request, $response, $args) { | ||||
|             // Render index view | ||||
| 			 | ||||
| 			if(isset($_POST["username"])){ | ||||
| 				echo "Jouw naam is: " . $_POST["username"] . " en je wachtwoord is: " . $_POST["password"] . "<br/>\n"; | ||||
| 			} | ||||
| 			$newResponse = $response->withHeader('Location', 'index.php'); | ||||
| 			return $this->renderer->render($newResponse, 'login.phtml', $args); | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| @@ -72,6 +72,7 @@ $container['renderer'] = function ($c) { | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| new InfD4p\Application\Login($app); | ||||
| new InfD4p\Application\Main($app); | ||||
|  | ||||
| /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user