Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Getting a php call to undefined function menu_name error and not sure how to fix

ID: 3832589 • Letter: G

Question

Getting a php call to undefined function menu_name error and not sure how to fix. Here is my code and a snip of the error.

<?php menuName("../includes/db_connection.php"); ?>
<?php menuName("../includes/functions.php"); ?>
<?php include("../includes/layouts/header.php"); ?>

<?php
if (isset($_GET["subject"])) {
      $selected_subjectId = $_GET["subject"];
      $selected_page_id = null;
} elseif(isset($_GET["page"])) {
      $selected_page_id = $_GET["page"];
      $selected_subjectId = null;
}else {
      $selected_subjectId = null;
      $selected_page_id = null;   
}

?>
<div id="main">
<div id="navigation">
       <?php echo navigation($selected_subjectId, $selected_page_id); ?>
</div>
<div id="page">
    <h2>Manage Content</h2>
   <?php echo $selected_subjectId; ?></br>
   <?php echo $selected_page_id; ?>  
</div>
</div>

<?php include("../includes/layouts/footer.php"); ?>

Explanation / Answer

I think its due to the first 2 lines in your code where in you meant to write "include" instead of "menuName".
Following is your code after correcting the 2 lines.
<?php include("../includes/db_connection.php"); ?>
<?php include("../includes/functions.php"); ?>
<?php include("../includes/layouts/header.php"); ?>
<?php
if (isset($_GET["subject"])) {
$selected_subjectId = $_GET["subject"];
$selected_page_id = null;
} elseif(isset($_GET["page"])) {
$selected_page_id = $_GET["page"];
$selected_subjectId = null;
}else {
$selected_subjectId = null;
$selected_page_id = null;   
}
?>
<div id="main">
<div id="navigation">
<?php echo navigation($selected_subjectId, $selected_page_id); ?>
</div>
<div id="page">
<h2>Manage Content</h2>
<?php echo $selected_subjectId; ?></br>
<?php echo $selected_page_id; ?>
</div>
</div>
<?php include("../includes/layouts/footer.php"); ?>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote