<div id="page"> <?php echo $subject["id"]; ?> <?php if (isset($_SESSION["message"])) { $output = "<div class=\"message\">"; $output .= htmlentities($_SESSION["message"]); $output .= "</div>"; echo $output; $_SESSION["message"] = null; } ?> <h2>Edit Subject : <?php $subject_title = find_subject_id("{$selected_subject_id}"); echo $subject_title['menu_name']; ?> </h2> <form action="create_subject.php" method="post"> <p> Subject name: <input type="text" name="menu_name" value="<?php echo $subject_title['menu_name']; ?> "> </p> <p> Position: <select name="position"> <?php
<?php session_start(); require_once "../includes/db_connection.php"; require_once "../includes/functions.php"; include '../includes/layouts/header.php'; if (isset($_GET["subject"])) { $selected_subject_id = htmlspecialchars($_GET["subject"]); $current_subject = find_subject_id($selected_subject_id); $selected_page_id = null; $current_page = null; } elseif (isset($_GET["page"])) { $selected_subject_id = null; $current_subject = null; $selected_page_id = htmlspecialchars($_GET["page"]); $current_page = find_page_id($selected_page_id); } else { $current_subject = null; $current_page = null; $selected_page_id = null; $selected_subject_id = null; } ?> <div id="main"> <div id="navigation"> <ul class="subjects"> <?php $subjects = find_all_subjects(); ?> <?php