Hocam sen session dan almıyosunki $pass ın sessiondan alınması gerek
edit böle yap yani
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="292" border="0">
<td width="118">
<tr>
<td width="45">İsminiz</td>
<td width="144"><form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="text" name="ad" /> *
<?PHP
if (isset($_POST["ad"]) && $_POST["ad"]=="")
echo "Adınızı giriniz";
?>
</td>
</tr>
<tr>
<td>E-mail</td>
<td width="164">
<input type="text" name="mail" /> *
<?PHP
if (isset($_POST["ad"]) && $_POST["ad"]=="")
echo "Mail Adresinizi Giriniz";
?></td>
</tr>
<tr>
<td >Güvenlik Kodu</td>
<td ><img src="guvenlik.php" alt="guvenlik" border="0"/></td>
</tr>
<tr>
<td height="40" > Kodu Giriniz</td>
<td >
<input type="text" name="guvenlik" size="25" ><?PHP
if (isset($_POST["guvenlik"]) && $_POST["guvenlik"]=="" )
echo "Parolayı giriniz";
?></td>
<tr>
<td>Mesajınız</td>
<td>
<textarea name="mesaj" id="textarea" cols="20" rows="5"></textarea> </td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Gönder" /> <input type="reset" value="Temizle" /></form></td>
</tr>
</table>
</body>
</html>
<?php
if(extract($_POST)) {
$tarih = date ("d.m.y");
// Tarihi aliyoruz.
$saat = date ("h:i:s");
// Saati aliyoruz
$ip =$_SERVER['REMOTE_ADDR'];
//Ziyaretçinin ip numarasini aliyoruz.
$to = "mail@mail.com";
$subject = " Mail Formu";
$name = $_POST['ad'] ;
$name = mb_convert_encoding($name ,"iso-8859-9","utf-8");
$email = $_POST['mail'] ;
$message = $_POST['mesaj'] ;
$message = mb_convert_encoding($message ,"iso-8859-9","utf-8");
session_start();
$pass= $_SESSION["guvenlik"];
$headers = "From: ". $name . " <" . $email . ">\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-9\r\n";
$mesa = "Ad Soyad: $name \n Mail Adresi: $email \n Mesaj: $message \n Ip No : $ip \n Tarih : [$tarih] Saat : [$saat]";
if( empty($name) || empty($mail) || empty($message) ) {
echo "Lütfen Gerekli Alanları Doldurunuz!";
}
elseif ($pass=="")
{echo "Lütfen Parolayı Giriniz";}
elseif (isset($_POST["guvenlik"]) || $_POST["guvenlik"] != $pass)
{echo "Parolayı Doğru Giriniz";}
elseif (isset($_POST["guvenlik"]) && $_POST["guvenlik"] == $pass)
$sent = mail($to, $subject, $mesa, $headers);
}
?>