Working challenge ! #6

Merged
david.cozariuc merged 9 commits from 2-site-design-basic into main 2025-09-23 19:05:50 +02:00
15 changed files with 76 additions and 9 deletions
Showing only changes of commit 9ec0afcee8 - Show all commits

View File

@ -8,3 +8,5 @@ autorestart=true
[program:apache2] [program:apache2]
command=/usr/sbin/apache2ctl -D FOREGROUND command=/usr/sbin/apache2ctl -D FOREGROUND
autorestart=true autorestart=true
# [program:mysql-server]

View File

@ -10,6 +10,7 @@ RUN apt update && apt upgrade -y && \
vim \ vim \
supervisor \ supervisor \
openssh-server \ openssh-server \
mysql-server \
sudo \ sudo \
cowsay \ cowsay \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*

View File

@ -10,21 +10,24 @@
<body> <body>
<div class="nav-bar"> <div class="nav-bar">
<ol> <ol>
<a href="/"><li><img alt="logo" class="logo" src="static/img/logo.jpg"> Tux Gallery </li></a> <a href="/index.php"><li><img alt="logo" class="logo" src="static/img/logo.jpg">Tux Gallery </li></a>
<a href="/view.html"><li>View</li></a> <a href="/login.php"><li>Login</li></a>
<a href="/login.html"><li>Login</li></a>
</ol> </ol>
</div> </div>
<div class="wrapper"> <div class="wrapper">
<section class="info-part"> <section class="info-part">
<h1>Tux gallery</h1> <h1>Tux gallery</h1>
<p>Tux is awesome ! So I made this extremely secure gallery.</p> <p>Tux is awesome ! So I made this extremely secure gallery.</p>
<p>You can also add tux pictures to the gallery, first <a href="login.html">login</a> and then you should be able to upload a new image of tux.</p> <p>You can also add tux pictures to the gallery, first <a href="login.php">login</a> and then you should be able to upload a new image of tux.</p>
</section> </section>
<section class="gallery-part"> <section class="gallery-part">
<div class="gallery"> <div class="gallery">
<img alt="placeholder"> <?php
<img alt="placeholder2"> foreach (new DirectoryIterator('static/img/gallery') as $file) {
if($file->isDot()) continue;
print '<img src="static/img/gallery/'. $file->getFilename() . '">';
}
?>
</div> </div>
</section> </section>
</div> </div>

View File

40
www/login.php Normal file
View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tux gallery !</title>
<link rel="stylesheet" href="static/css/stylesheet.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="nav-bar">
<ol>
<a href="/index.php"><li><img alt="logo" class="logo" src="static/img/logo.jpg">Tux Gallery </li></a>
<a href="/login.php"><li>Login</li></a>
</ol>
</div>
<div class="wrapper">
<form id="loginForm" method="POST" action="login.php">
<h1>Login</h1>
<p>Note : The register feature is not implemented yet !</p>
<label for="username">Username</label>
<input type="text" id="username" name="username">
<label for="password">Password</label>
<input type="password" id="password" name="password">
<input type="button" class="btn btn-primary" value="Login">
</form>
</div>
<?php
if (! empty($_POST)) {
$name = $_POST['username'];
$password = $_POST['password'];
if (empty($name)) {
echo "Username is empty";
} else {
echo $name;
}
}
?>
</body>
</html>

View File

@ -39,9 +39,30 @@
.wrapper { .wrapper {
display:flex; display:block;
align-content: center; margin-left:15%;
justify-content: center; margin-right:15%;
} }
.info-part{
margin-left:25%;
margin-right:25%;
}
.gallery img{
max-width:250px;
max-height:250px;
}
.gallery{
padding:10px;
background-color:black;
display:grid;
grid-template-columns: auto auto auto auto;
}
#loginForm{
display:grid;
margin-right:30%;
margin-left:30%;
gap:5px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 KiB