Witam.
Zamiast wyświetlić mi pod spodem wszystkie dane , nic się nie dzieje

Czy mogłby mi ktoś coś podpowiedzieć ? Nie znam jeszcze zbyt dobrze php i nie bardzo wiem w czym problem.
<?php
$imie = $_GET['imie'];
@$nazwisko = $_GET['nazwisko'];
@$ulica = $_GET['ulica'];
@$nrdomu = $_GET['nrdomu'];
@$kod = $_GET['kod'];
@$miasto = $_GET['miasto'];
@$kraj = $_GET['kraj'];
@$telefon = $_GET['telefon'];
if ($imie == "" and $nazwisko=="" and $kraj=="" and $telefon==""){
print ("prosze podac wszytskie wymagane danee"); return;
}
$link = mysql_connect ('localhost','marek','marek123','formularz'); if (!$link and !$flag){
echo 'problem z polaczeniem'; }
$query = "insert into osoba (imie, nazwisko, ulica, nrdomu, kod, miasto, kraj, telefon)";
$query .="values('".$imie."','";;
$query .=$nazwisko."','";
$query .=$ulica."','";
$query .=$nrdomu."','";
$query .=$kod."','";
$query .=$miasto."','";
$query .=$kraj."','";
$query .=$telefon."','";
$query .=")";
$result = $query;
if (!$result){
print ("problem z zapytaniem do bazy danych"); }
print ("dziekujemy za wypelnienie formularza"); ?>
<?php
@$id = $_COOKIE["id"];
$code1 = "";
function getdata($id){
$link = mysql_connect ('localhost','marek','marek123','formularz'); if (!$link and !$flag){
}
$query = "select * from osoba where id = ".$id;
if (!$result){
echo 'odrzucone zapytanie'; }
$res = $row[1]."<br>";
$res = $row[2]."<br>";
$res = $row[3]."<br>";
$res = $row[4]."<br>";
$res = $row[5]."<br>";
$res = $row[6]."<br>";
$res = $row[7]."<br>";
$res = $row[8]."<br>";
return $res;
}
if (!$id <> ""){
$code1 = "<h2>Zostales rozpoznany jako:<br><br>";
$code1 .=getdata($id);
$code1 .= "</h2>";
}
else{
include("dane.html");
return;
}
$kod =
"<html>".
"<head></head>".
"<body>".
$code1.
"</body>".
"</html>";
?>