Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added assets/img/gato_fachero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

body {
background-color:lightsteelblue;
}

#login-button {
background-color:lightsteelblue;
font-weight: bold;
}

#logout-button {
background:lightsteelblue;
font-weight: bold;
}

#sing-button {
background-color: lightgreen;
font-weight: bold;
}

#logout-box {
color: white;
}

#login-box {
color: white;
}

#header-float-box {
border-radius: 40px;
}

#footer-text {
display: flex;
font-family: Great Vibes;
font-size: 3rem;
justify-content: right;
align-items: center;
color: white;
}
9 changes: 9 additions & 0 deletions close_session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
session_start();

if(isset($_REQUEST["logout"])){
session_destroy();
header("Location: index.php");
}

?>
7 changes: 7 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<footer >
<div class="bg-dark m-0" id="footer-text">
<p class="m-4">By Berners-Lee<p>
</div>
</footer>
</body>
</html>
20 changes: 20 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Session login exercise</title>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap" rel="stylesheet">
</head>
<body>
<header>
<div class="bg-dark">
<img src="assets/img/gato_fachero.png" alt="cat with glasses">
</div>
</header>

50 changes: 50 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
include "header.php";


function errorDataUser() {
if (isset($_REQUEST["error1"])) {
echo ("<p class='bg-danger text-center p-1'>Email or password incorrect</p>");
}
}

function errorPrivateZone() {
if (isset($_REQUEST["error2"])) {
echo ("<p class='bg-danger text-center p-1'>Private zone, you need to login or register first.</p>");
}
}

function backToSign(){
if (isset($_REQUEST["sing-up"])){
header("Location: index.php");
}
}

backToSign();


?>
<div class="container-fluid text-center d-flex justify-content-center align-items-center">
<div class="text-white col-md-2 rounded-bottom bg-dark">
<h3 class="">Log in page </h3>
</div>
</div>
<section class="container-fluid row align-items-center justify-content-center vh-100">
<div class="col-md-2 rounded">
<div class="bg-dark rounded" id="login-box">
<p class="text-white text-center p-3 mb-0">Login</p>
<?php
if(isset($_GET["error2"]))echo(errorPrivateZone());
if(isset($_GET["error1"]))echo(errorDataUser());
?>
<form action="validate.php" method="POST" class="row p-5 pt-0 pb-3" >
<input type="text" name="email" placeholder="Email" class="text-center rounded-3 border-0" required>
<input type="password" name="password" placeholder="Password" class="text-center rounded border-0 mt-2" required>
<button type="submit" class="btn rounded p-1 mt-3" id="login-button">Login</button>
</form>
</div>
</div>
</section>
<?php
include("footer.php")
?>
5 changes: 5 additions & 0 deletions info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

phpinfo();

?>
35 changes: 35 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions node_modules/@popperjs/core/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading