Jump to content

Gladelvira

New Members
  • Posts

    1
  • Joined

  • Last visited

Gladelvira's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a problem with my <nav> bar ending up outside my <html> code, can someone help me explain where the problem is? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Send</title> <link rel="stylesheet" property="stylesheet" type="text/css" href="css/stylesheet.css"> </head> <body> <?php session_name('Website'); session_start(); $host = "localhost"; $user = "josgla22"; $pwd = "_fLhYXqDRB"; $db = "josgla22_db"; $mysqli = new mysqli($host, $user, $pwd, $db); $navigation = <<<END <nav> <a href="index.php">Home</a> <a href="about.php">About</a> <a href="products.php">Products</a> END; if (isset($_SESSION['userId'])) { $navigation .= <<<END <a href="register.php">Register</a> <a href="logout.php">Logout</a> END; if ($_SESSION['username'] === 'admin') { $navigation .= '<a href="add_product.php">Add Product</a>'; } $navigation .= 'Logged in as ' . $_SESSION['username']; } else { $navigation .= <<<END <a href="login.php">Login</a> END; } $navigation .= '</nav>'; ?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.