I have successfully connected to database and published mysql data on web and manually added joke on it.Screenshot of what output looks like is provided here.

When i manually enter the corresponding id of joke inside the textbox and press delete button, it deletes the joke corresponding to that it. But when i click on the delete button directly, that joke isn't deleted. How to update value of that textbox ? For the time being, i have made input type of textbox as text so to see whats going inside it. I am using PHP version: 7.1.1 and Apache/2.4.25 (Win32.
<p><a href="?addjoke">Add your own joke</a></p>
<p>Here are all the jokes in the database:</p>
<?php foreach ($jokes as $joke) : ?>
<form action ="?deletejoke" method='post'>
<blockquote>
<p><?php echo htmlspecialchars($joke['text'], ENT_QUOTES, 'UTF-8');?>
<input type = "text" name = "id" value = "<? php echo $joke['id']; ?>">
<input type = 'submit' value = 'Delete'>
</p>
</blockquote>
</form>

?andphp