Aggiunta cognome in sessione

This commit is contained in:
2026-04-08 10:56:58 +02:00
parent 1239dc419e
commit a6d66a5253
5 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -16,9 +16,9 @@ session_start();
<div id="logo" style="font-size: 24px; font-weight: bold;"><a href="index.php"><img src="img/logo.png" alt="Logo TechStore" height="32px"></a></div>
<div>
<a href="cart.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer;">Carrello</button></a>
<?php if (isset($_SESSION['user'])): ?>
<?php if (isset($_SESSION['name'])): ?>
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['user']); ?></a></span>
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
<?php else: ?>
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
<?php endif; ?>