<?php
session_start();
      if($_SESSION[pass]!=$_POST[kod])

{

echo "hatalı güvenlik kodu"; 

}
?>
session_start(); unutmuşsun.