Здравствуйте. Я взял с интернета простенькую систему регистрации и авторизации. Там был в комплекте еще профиль. Но как я бы не добавлял навигацию или други пункты все было в один стиль либо вообще не отображалось. Если не сложно подскажите как!
Код:
PHP:
<?php if (!$_SESSION[‘user’]) { } ?> <!doctype html> <html lang=»en»> <head> <meta charset=»UTF-8″> <title>Профиль</title> <link rel=»stylesheet» href=»assets/css/main.css»> </head> <body> <!— Профиль —> <form> <img src=»<?= $_SESSION[‘user’][‘avatar’] ?>» width=»200″ alt=»»> <h2 style=»margin: 10px 0;»><?= $_SESSION[‘user’][‘full_name’] ?></h2> <a href=»#»><?= $_SESSION[‘user’][’email’] ?></a> <a href=»vendor/logout.php» class=»logout»>Выход</a> </form> <!—Другая важная информация—> </body> </html>css:
Код (CSS):
* { margin: 0; padding: 0; box-sizing: border-box; } body { height: 100vh; display: flex; align-items: center; justify-content: center; font-family: Montserrat, sans-serif; } a { color: #7c9ab7; font-weight: bold; text-decoration: none; } p { margin: 10px 0; } form { display: flex; flex-direction: column; width: 400px; } input { margin: 10px 0; padding: 10px; border: unset; border-bottom: 2px solid #e3e3e3; outline: none; } button { padding: 10px; background: #e3e3e3; border: unset; cursor: pointer; } .error { border-bottom: 2px solid #ff4332; } .msg { border: 2px solid #ffa908; border-radius: 3px; padding: 10px; text-align: center; font-weight: bold; } .none { display: none; } .logout { color: #b7625c; }
Добрый день!
Проверьте $_SESSIONPHP:
<?php ?>Или попробуйте заменить в HTML, например, <?= $_SESSION[‘user’][’email’] ?> на XXXXX
Чтобы было понято, где пункты навигации, советую Вам изменить в CSSКод (CSS):
a { color: #7c9ab7; font-weight: bold; text-decoration: none; cursor: pointer } a:hover{ text-decoration: underline }Удачи!