mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 14:52:04 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
65fb68d68e
|
|||
|
65888cc865
|
|||
|
5fa3aa7c24
|
|||
|
0e393b9318
|
|||
|
1823553f55
|
|||
|
cfcc449614
|
|||
|
a8690feafc
|
|||
|
3ffa3435a4
|
@@ -0,0 +1,25 @@
|
||||
services:
|
||||
techstore:
|
||||
image: andrestork/techstore:dev
|
||||
ports:
|
||||
- 8069:80
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_USERNAME: techstore
|
||||
DB_PASSWORD: changeme
|
||||
DB_DATABASE: TechStore
|
||||
volumes:
|
||||
- ./images:/var/www/html/img
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: mariadb
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: changemeplease
|
||||
MARIADB_USER: techstore
|
||||
MARIADB_PASSWORD: changeme
|
||||
MARIADB_DATABASE: TechStore
|
||||
volumes:
|
||||
- ./db:/var/lib/mysql
|
||||
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
include '../db_conf.php';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
@@ -8,9 +12,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
include '../db_conf.php';
|
||||
|
||||
if (!isset($_SESSION['id'])) {
|
||||
header('Location: ../login.php');
|
||||
exit();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
include '../db_conf.php';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
@@ -8,9 +12,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
include '../db_conf.php';
|
||||
|
||||
if (!isset($_SESSION['id'])) {
|
||||
header('Location: ../login.php');
|
||||
exit();
|
||||
|
||||
+7
-6
@@ -5,12 +5,13 @@ $username = getenv("DB_USERNAME") ?:'techstore';
|
||||
$password = getenv("DB_PASSWORD") ?: 'dioporco';
|
||||
$database = getenv("DB_DATABASE") ?: 'TechStore';
|
||||
|
||||
// Creazione connessione
|
||||
$conn = mysqli_connect($host, $username, $password, $database);
|
||||
|
||||
// Controllo connessione
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
// Creazione e gestione eccezioni connessione
|
||||
try{
|
||||
$conn = mysqli_connect($host, $username, $password, $database);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
error_log("Errore connessione database: " . $e->getMessage());
|
||||
die("Errore di connessione al database. Riprova più tardi.");
|
||||
}
|
||||
|
||||
// Opzionale: impostare charset
|
||||
|
||||
+19
-16
@@ -1,19 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
include 'db_conf.php';
|
||||
<?php
|
||||
session_start();
|
||||
include 'db_conf.php';
|
||||
|
||||
$error = '';
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
@@ -45,8 +36,20 @@
|
||||
} else {
|
||||
$error = 'Errore nel database.';
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST">
|
||||
<h2>Login</h2>
|
||||
<label for="email">Indirizzo e-mail:</label>
|
||||
|
||||
Reference in New Issue
Block a user