hocam olmadı ya
<?php
session_start();
function gonder($ad, $soyad, $mail, $konu, $mesaj, $guvenlik)
{
if ($_SESSION['guvenlik'] == $guvenlik)
{
$kimden = "Radyo Çankaya - İstek Hattı";
$baslik = "Yeni bir istek!";
$sablon = '<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" /><table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" colspan="3" align="center" bgcolor="#0099CC"><span style="font-family:Tahoma; font-size:12px; color:#FFF;">Yeni İstek Gönderildi.</span></td>
</tr>
<tr>
<td width="100" height="25" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">Adı</span></td>
<td width="5" align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td width="281" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">'. $ad . '</span></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#F3F3F3"><span style="font-family:Tahoma; font-size:12px; color:#000;">Soyadı</span></td>
<td align="center" bgcolor="#F3F3F3"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="left" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">'. $soyad .'</span></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">Mail Adresi</span></td>
<td align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">'. $mail .'</span></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">Konu</span></td>
<td align="center" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="left" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">'. $konu .'</span></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">Mesaj</span></td>
<td align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">'. $mesaj .'</span></td>
</tr>
</table>';
$header="From: $kimden\r\n"."Content-Type: text/html; Charset=utf-8";
mail ("istek@radyocankaya.com",$baslik,$sablon,$header);
if (mail)
{
echo '<table width="220" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #9F0;"><tr><td align="center"><span style="font-family:Tahoma; font-size:12px; color:#9F0;">İsteğiniz Ulaşmıştır.Teşekkür Ederiz.</span></td></tr></table>';
}
else
{
echo '<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #CC0000; padding:5px; margin-bottom:10px;"><tr><td align="center"><span style="font-family:Tahoma; font-size:12px; color:#9F0;">Mesajınız Gönderilirken Bir Sorun Meydana Geldi.</span></td></tr></table>';
}
}
else
{
echo '<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #CC0000; padding:5px; margin-bottom:10px;"><tr><td align="center"><span style="font-family:Tahoma; font-size:12px; color:#CC0000;">Güvenlik Kodunu Hatalı Girdiniz!</span></td></tr></table>';
}
}
if (@$_GET['islem'] == "gonder")
{
@header('Content-Type: text/html; Charset=iso-8859-9');
gonder($_POST['ad'], $_POST['soyad'], $_POST['mail'], $_POST['konu'], $_POST['mesaj'], intval($_POST['guvenlik']));
exit;
}
?>
<!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>
<title>Radyo Çankaya - İstek Hattı</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function kontrol(ad, soyad, konu, mesaj, guvenlik)
{
if(ad == '') {
alert('Lütfen Adınızı Yazın!');
return false;
}
else if(soyad == '') {
alert('Lütfen Soyadınızı Yazın!');
return false;
}
else if(konu == '') {
alert('Lütfen Konuyu Yazın!');
return false;
}
else if(mesaj == '') {
alert('Lütfen Mesajınızı Yazın!');
return false;
}
else if(guvenlik == '') {
alert('Lütfen Güvenlik Kodunu Yazın!');
return false;
}
return true;
}
$(document).ready(function() {
$('input[type="text"]').focus(function() {
$(this).css({'border':'1px solid #009ac8'});
});
$('input[type="text"]').blur(function() {
$(this).css({'border':'1px solid #aaaaaa'});
});
$('#gonder').click(function() {
var ad = $('#ad').val();
var soyad = $('#soyad').val();
var konu = $('#konu').val();
var mesaj = $('#mesaj').val();
var guvenlik = $('#guvenlik').val();
// Kontrol işlemi sorunsuz ise ajax ile form yollanıyor
if (kontrol(ad, soyad, konu, mesaj, guvenlik) == true) {
var gonderiliyor = '<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #666; padding:5px; margin-bottom:10px;"><tr><td align="center"><div style="font: normal 12px tahoma; width: 220px; height: 19px; background: url(ajax-loader.gif); color: #ffffff; text-align: center;"><div style="padding-top:2px;">Gönderiliyor...</div></div></td></tr></table>';
$('#sonuc').html(gonderiliyor);
// Post için formu serialize ediyoruz
var veriler = $('#iletisim').serialize();
$.ajax({
type: "POST",
url: "<?php echo $_SERVER['SCRIPT_NAME']; ?>?islem=gonder",
data: veriler,
success: function(msg){
$('#sonuc').html(msg);
}
});
}
});
});
</script>
<style type="text/css">
.guvenlikrengi {
font-size:14px;
color: #FFF;
}
</style>
</head>
<body>
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>?islem=gonder" method="post" style="margin: 0px;" id="iletisim" onsubmit="return false;">
<table width="400" border="0" align="left" cellpadding="0" cellspacing="0" style="border: 0px solid #666; color: #CCC; font-size: 12px;">
<tr>
<td height="30" colspan="4" align="left" style="border-bottom:1px solid #666;"><table width="396" border="0">
<tr>
<td width="145" height="25"><span style="font-family:Tahoma; font-size:12px; color:#FFF;">Radyo Çankaya İstek Hattı</span></td>
<td width="241"><div id="sonuc" style="text-align: center;"></div></td>
</tr>
</table> <span style="font-family:Tahoma; font-size:12px; color:#FFF;">
</span></td>
</tr>
<tr>
<td width="56" height="30" align="left"><span style="font-family:Tahoma; font-size:14px; color:#ffffff;"> Adınız :</span></td>
<td width="172" align="center"><span style="font-family:Tahoma; font-size:14px; color:#ffffff;">
<input type="text" name="ad" id="ad" style="width:150px; border:1px solid #ffffff;" /></span></td>
<td width="170" align="left">Güvenlik Kodunu Giriniz:</td>
</tr>
<tr>
<td height="30" align="left"><span style="font-family:Tahoma; font-size:14px; color:#ffffff;"> Mesaj :</span></td>
<td align="center" ><span style="font-family:Tahoma; font-size:14px; color:#ffffff;">
<textarea name="mesaj" id="mesaj" rows="2" style="width:150px; border:1px solid #aaa;"></textarea>
</span></td>
<td align="left"><span class="guvenlikrengi">
<?php
$int1 = rand(1, 9);
$int2 = rand(1, 9);
$toplam = $int1 + $int2;
echo $int1 . ' + ' . $int2 . ' = ?';
$_SESSION['guvenlik'] = $toplam;
?>
<input type="text" name="guvenlik" style="width:40px; border:1px solid #ffffff;" id="guvenlik" />
<span style="height: 70px;">
<input type="button" value="Gönder" id="gonder" style="border:1px solid #666; background-color:#0099CC; color:#FFF; padding:2px; cursor:pointer;" />
</span></span></td>
</tr>
</table>
</form>
</body>
</html>kodlarda biraz saçmaladım sanırım...