0
            <?php 
                $qr_topic = @mysql_query("SELECT * FROM topics");
                while ($topic = @mysql_fetch_array($qr_topic)) {
                    $highlight = "";
                    **if ($topic['name'] == $_GET['topic'] || $post['topic_id'] == $topic['id']) {**
                        $highlight = "class='highlight'";
                    }
                    echo "<li ".$highlight."><a href='index.php?topic=".$topic['name']."'>".$topic['name']."<img src='img/".$topic['image']."'  width='195' height='90' /></a></li>";
                }
            ?>

Getting Undefined index error, not sure what is wrong ? This could be the line for error. if ($topic['name'] == $_GET['topic'] || $post['topic_id'] == $topic['id']) {**

user1644207
  • 1
  • 2
  • 3

1 Answers1

0

You try to use $_GET['topic'] without checking if it exists first, that's why you get that error. I'd recommend you to test if the variable exists first using is_set() or empty().

Sharpless
  • 13
  • 3