echo '<td><a href="candidates.php?id=' . $row['candidate_id'] . '">Delete Candidate</a></td>';
How can i add a confirmation message before the data will be deleted? Like asking are you sure
echo '<td><a href="candidates.php?id=' . $row['candidate_id'] . '">Delete Candidate</a></td>';
How can i add a confirmation message before the data will be deleted? Like asking are you sure
Try this
echo '<td><a href="candidates.php?id=' . $row['candidate_id'] . '" onclick="return confirm('Are you sure...?')">Delete Candidate</a></td>';
Use confirm function from javascript
confirm('message');
echo '<td><a href="candidates.php?id=' . $row['candidate_id'] . '" onclick="return confirm('message goes here')">Delete Candidate</a></td>';