Te falta la llave } para cerrar el if.
Código PHP:
<html>
<head>
<body>
<?php
if (isset($dni)){
$link = mysql_connect("localhost", "root", "pasword");
mysql_select_db("becario2");
$dni=$_get['dni'];
mysql_query("delete from profesores where dni='".$_get['dni']."'");
header("Location: index.php");
}
?>
</body>
</head>
</html>
Saludos.