0

First of all I would like to say that I am not just using php to echo this there is more functionality but I have realised that this is where it crashes. Also it does work if I remove the echo's sorry if this is something stupid. My index.php is including my navbar.php so I will include both. Here is the error

[Fri Aug 25 18:44:05.859141 2017] [fcgid:warn] [pid 10641:tid 140118853633792] [client 77.54.162.155:50880] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected 'javascript' (T_STRING), expecting ',' or ';' in /var/www/vhosts/woodwardmedia.co.uk/Orders/php/navbar.php on line 11

Index.php

<?php
    session_start();
    if (isset($_SESSION['id'])){
    }
    else
    {
        header("Location: https://orders.woodwardmedia.co.uk/login.php"); /* Redirect browser */
        exit();
    }
?>

<!DOCTYPE html>
<html>
    <head>
        <title>Main Page</title>
        <link href="IndexStyle.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <?php
            include 'php/navbar.php';
        ?>
    </body>
</html>

navbar.php

<?php
    session_start();
?>
<header>
            <div class="container">
                <a href="https://woodwardmedia.co.uk"><img src="img/SmallLogo.png" alt="Logo" class="Logo"></a>
                <nav>
                    <ul>
                        <li class="dropdown">
                        <?php
                                echo "<a href="javascript:void(0)" class="dropbtn">Order</a>";
                                echo "<div class="dropdown-content">";
                                        echo "<a href="Orders-Completed.php">Completed</a>";
                                        echo "<a href="Orders-Current.php">Current</a>";
                                        echo "<a href="Orders-Requested.php">Requested</a>";
                                echo "</div>";
                        ?>
                            </li>
                        <li><a href="Create-an-Order.php">Create an Order</a></li>
                        <li class="dropdown">
                            <a href="javascript:void(0)" class="dropbtn">Users</a>
                            <div class="dropdown-content">
                                <a href="Edit-a-User.php">Edit A User</a>
                                <a href="Create-a-User.php">Create A User</a>
                            </div>
                        </li>
                        <li><a href="LogoutScript.php" class="logout">Logout</a></li>
                    </ul>
                </nav>
            </div>
        </header>
Smadger
  • 16
  • 5

0 Answers0