in the code that dynamically generates the topics, you also put code that generates a link that says "delete". You dyanically generate a variable name and the primary key of the topic in the "href" attribute of the anchor tag, so that the command to delete and the primary key are passed to the page via GET when when the delete link is clicked. At the top of the page you include the script to delete from the topic with that primary key from the database if the variable in the herf attribute is set.