Instead of this:
echo '<td><a href="finalphp/deleteCourse.php?id=' . $row['courseid'] . '" onclick="deleteC()");"><font color="#e70404"> Delete </font> </a></td>';
Just pass the id to the JS function as a parameter and use it:
PHP:
echo '<td><a href="finalphp/deleteCourse.php?id=' . $row['courseid'] . '" onclick="deleteC(' . $row['courseid'] . ')");"><font color="#e70404"> Delete </font> </a></td>';
JS
function deleteC(deleteId){
$.ajax({
type: "GET",
url: "deleteCourse.php",
data:{'courseid':deleteId},
success: function(result){
if(result=='correct'){
window.location='index.php';
} else {
}
}
});
}