所以我想制作一个dinamyic菜单,但我遇到了未定义的索引问题,你能帮我找出原因吗?
<?php
include_once('includes/connection.php');
include_once('includes/articol.php');
$articol = new articol;
$articole = $articol->fetch_all();
?>
来自身体的代码
<li id="current"><a class="links" href="index.html">Acasa</a></li>
<?php foreach ($articole as $articol) { ?>
<li><a class="links" href="articol.php?id=<?php echo $articol['articol_id']; ?>">
<?php echo $articol['articol_titlu']; ?>
</a></li>
<li><a class="links" href="galben.html">Galben</a></li>
<li><a class="links" href="albastru.html">Albastru</a></li>
<li><a class="links" href="drapel.html">Drapel</a></li>
<li><a class="links" href="despre.html">Despre</a></li>
<li><a class="links" href="contact.html">Contact</a></li>
<?php } ?>
我在
处获得了未定义的索引<li><a class="links" href="articol.php?id=<?php echo $articol['articol_id']; ?>">
<?php echo $articol['articol_titlu']; ?>