You are trying to use variables that are not initialized yet. So use isset() always on such variables that maybe are not initialized yet.
Theres no need to use sessions at all. If you are submitting to the same page, you can use the $_POST variables to fill the form againg with erronous values. So do the redirect after the form process is succesfull.
Heres that code with corrections. There was some minor things that I changed like changed $SERVER['PHP_SELF'] to $SERVER['SCRIPT_NAME'] (using PHP_SELF has some security problems(XSS)).
<?php
error_reporting(E_ALL);
// initialize $tel and $nume
$tel = '';
$nume = '';
if(isset($_POST['dta']) AND is_array($_POST['dta'])) {
$err = array();
foreach ($_POST['dta'] as $k => $v) {
switch($k) {
case "nume":
if (strlen($v) <= 3) $err[$k]=1;
$nume = $v;
break;
case "tel":
if (!is_numeric($v)) $err[$k]=1;
$tel = $v;
break;
}
}
if (empty($err))
{
// no errors. Do your thang (eg. insert data to database)
// redirect the page to prevent posting the form again
header('Location: somepage.php');
exit;
}
/* THIS IS NOT NEEDED AT ALL
if (!empty($err)) {
$_SESSION['dta']= $_POST[dta];
$_SESSION['err']= $err;
header("Location: pula.php");
exit;
}
*/
}
?>
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" enctype="application/x-www-form-urlencoded">
nume : <input name="dta[nume]" type="text" id="dta[nume]" value="<?php echo $nume ?>" />
<?php if (isset($err['nume'])): ?>
<div style="color:#F00">Numele este mai scurt de 3 litere!</div>
<?php endif; ?>
<br />
<br />
nr tel : <input name="dta[tel]" type="text" id="dta[tel]" value="<?php echo $tel ?>" />
<?php if (isset($err['tel'])): ?>
<div style="color:#F00">Nr de tel nu este numeric!</div>
<?php endif; ?>
<br />
<br />
<input name="test" type="submit" value="test" id="test" />
</form>