Foruma girilen değerleri çekip mail adresine gönderiyorum.
Sorun şuradan kaynaklanıyor.
3 çeşit ödeme sistemi var Havale, Kredi kartı ve Kapıda ödeme.
Bu ödeme seçeneklerini tıklanınca açılan div ve radio butonlarından yaptım.
Havale seçilince CAPTCHA çalışıyor (kodu 223 - 235. satırda).
Kredi kartı seçilincede CAPTCHA çalışıyor(kodu 210 - 217. satırda).
Fakat Kapıda ödeme seçeneğinin elseif kontrolünü bir türlü doğru şekilde yapamadığımdan CAPTCHA kontrolünü yapmadan formu gönderiyor(kodu 170 - 182. satırda).
Yardımcı olabilirseniz sevinirim. Kodu aşağıya pasteledim
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<title>Sipariş Formu</title>
<LINK REL="SHORTCUT ICON" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="stil.css">
<script language=JavaScript>
<!--
function stoperror(){
return true
}
window.onerror=stoperror
-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"></head>
<body onError="return false;" onLoad="document.forms[0].reset();">
<div id="icerik">
<div id="anaIcerik">
<table width="100%">
<tr>
<td align="center"><h1>Sipariş Formu</h1></td>
</tr>
<tr>
<td valign="top">
<?
$dizi = array();
$dizi[0]="A";
$dizi[1]="B";
$dizi[2]="C";
$dizi[3]="D";
$dizi[4]="E";
$dizi[5]="F";
$dizi[6]="G";
$dizi[7]="H";
$rand=$dizi[rand(0,7)];
$rand .= rand(123,5432);
$rand.=$dizi[rand(0,7)];
$kod = $rand;
?>
<script language="JavaScript">
function kontrol(a,b)
{
if(a!=b)
{
alert("Güvenlik Numarasini Yanlis Yazdiniz");
return false;
}else
{
return true;
}
}
function chc()
{
var bir = document.getElementById('bir');
var adsoyad = document.getElementById('adsoyad');
var telefon = document.getElementById('telefon');
var mail = document.getElementById('mail');
var adres = document.getElementById('adres');
var aciklama = document.getElementById('aciklama');
var radiobutton = document.getElementById('radiobutton');
var banka = document.getElementById('banka');
if(adsoyad.value==0)
{
alert('Lütfen Adınızı ve Soyadınızı Yazınız');
adsoyad.style.backgroundColor='#ff0000';
return false;
}else if(telefon.value==0)
{
alert('Lütfen Telefon Numaranizi Giriniz');
telefon.style.backgroundColor='#ff0000';
return false;
}else if(mail.value<0)
{
alert("'Mail Adresiniz' Alanini Yaziniz");
mail.style.backgroundColor='#ff0000';
return false;
}else if((mail.value.indexOf('@')<0) || (mail.value.indexOf('.')<0) )
{
alert("Lütfen Geçerli bir E-Posta Adresi Yazınız");
return false;
}else if(adres.value<10)
{
alert("Lütfen En az 10 karakterlik bir açıklama yazınız..");
adres.style.backgroundColor='#ff0000';
return false;
}else if(radiobutton.value=="Kapida")
{
if(kontrol('<?=$kod?>',document.getElementById('kod').value)==false)
{
return false;
}else{
return true;
}
}else if(radiobutton.value=="KrediKarti")
{
if(document.getElementById('kart_no').value.length<16)
{
alert("Lütfen Kart Numaranızı Kontrol Ediniz");
return false;
}else if(document.getElementById('kart_Sahibi').value==0)
{
alert("Lütfen Kart Sahibi Alanını Giriniz");
return false
}else if(document.getElementById('tarih').value==0)
{
alert("Lütfen Ay Alanyny Seçiniz");
document.getElementById('tarih').focus();
return false;
}else if(document.getElementById('D3').value==0)
{
alert("Lütfen Yyl Alanyny Seçiniz");
document.getElementById('D3').focus();
return false;
}else if(document.getElementById('T3').value.length<3)
{
alert("Lütfen güvenlik Kodunuzu kontrol ediniz");
return false;
}else if(kontrol('<?=$kod?>',document.getElementById('kod').value)==false)
{
return false;
}else{
return true;
}
}else if(radiobutton.value=="Havale")
{
if(kontrol('<?=$kod?>',document.getElementById('kod').value)==false)
{
return false;
}else{
return true;
}
}
}
</script>
<script language="JavaScript" type="text/javascript" src="image-button.js">
</script>
<?
$tarih = date('d.m.Y - H:i:s');
$ip = $_SERVER['REMOTE_ADDR'];
$r = $_SERVER['HTTP_REFERER'];
$k = substr($r,10,7);
if($k!=".mysitem")
{
$r="";
}
if($_POST)
{
echo'<p>Siparişiniz Başarılı bir şekilde gönderilmiştir. Aşağıdaki linki tıklayarak alışverişinize kaldığınız yerden devam edebilirsiniz</p><br> <a href="'.$_POST["bir"].'">'.$_POST["bir"].'</a>';
$msg='
---------------SIPARIS FORMU ------------------
Formun Dolduruldugu Tarih : '.$tarih.'
IP Numarasi : '.$ip.'
-----------------------------------------------
Ürünün Adresi : '.$_POST["bir"].'
Adi Soyadi : '.$_POST["adsoyad"].'
Telefon No : '.$_POST["telefon"].'
Mail Adresi : '.$_POST["mail"].'
Adres : '.$_POST["adres"].'
Açıklama : '.$_POST["aciklama"].'
Odeme Sekli : '.$_POST["radiobutton"].'
Odeme Banka : '.$_POST["banka"].'
';
if($_POST['radiobutton']=="KrediKarti")
{
$msg.='
---------------------KART BILGILERI--------------------
Kart Tip : '.$_POST["kart_tipi"].'
Kart No : '.$_POST["kart_no"].'
Kart Sahibi : '.$_POST["kart_Sahibi"].'
Son Kullanma Tarihi : '.$_POST["tarih"].'
/
'.$_POST["D3"].'
Guvenlik Kodu : '.$_POST["T3"].'
';
}
$Name = "Siparis FOrmu";
$email = $_POST['mail'];
$recipient = "info@mysite.com";
$mail_body = $msg;
$subject = "Siparis FOrmu";
$header = "From: ". $Name . " <" . $email . ">\r\n";
@mail($recipient, $subject, $mail_body, $header);
}else
{
?>
<form id="form1" onsubmit="return chc();" name="form1" method="post" action="">
<table width="448" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="9"> </td>
<td width="102" height="28"><span class="style6">Ürün Adresi </span></td>
<td width="10" height="28">:</td>
<td width="327" height="28"><input readonly="TRUE" value="<?=$r;?>" name="bir" type="text" id="bir" style="background-image:url(bgText.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:25px;" /></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Adınız Soyadınız </td>
<td height="28">:</td>
<td height="28"><input name="adsoyad" type="text" id="adsoyad" style="background-image:url(bgText.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:25px;" /></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Telefonunuz</td>
<td height="28">:</td>
<td height="28"><input name="telefon" type="text" id="telefon" style="background-image:url(bgText.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:25px;" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" maxlength="11" /></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Mail Adresiniz </td>
<td height="28">:</td>
<td height="28"><input name="mail" type="text" id="mail" style="background-image:url(bgText.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:25px;" value="@" maxlength="50" /></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Teslimat Adresiniz yada kargo şubesi. </td>
<td height="28">:</td>
<td height="28"><textarea name="adres" rows="5" id="adres" style="background-image:url(bgarea.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:112px;"></textarea></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Özel açıklama</td>
<td height="28">:</td>
<td height="28"><textarea name="aciklama" rows="3" id="aciklama" style="background-image:url(bgarea.jpg);background-repeat:no-repeat; border-style:none;Border-Width:0px;Width:263px;Height:112px;"></textarea></td>
</tr>
<tr>
<td class="style6"> </td>
<td height="28" class="style6">Ödeme Şekli </td>
<td height="28">:</td>
<td height="28" class="style7"><input name="radiobutton" type="radio" onclick="document.getElementById('b1').style.display='inline';document.getElementById('b2').style.display='none';document.getElementById('b3').style.display='none';document.getElementById('radiobutton').value='Havale'" value="Havale" />
Havale
<input onclick="document.getElementById('b2').style.display='inline';document.getElementById('b1').style.display='none';document.getElementById('b3').style.display='none';document.getElementById('radiobutton').value='KrediKarti'" name="radiobutton" type="radio" value="KrediKarti" />
Kredi Kartı
<input onclick="document.getElementById('b3').style.display='inline';document.getElementById('b1').style.display='none';document.getElementById('b2').style.display='none';document.getElementById('radiobutton').value='Kapıda'" name="radiobutton" type="radio" value="Kapida" />
Kapıda </td>
</tr>
<tr>
<td> </td>
<td height="28"> </td>
<td height="28"> </td>
<td height="28">
<div id="b1" style="display:none;">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="101%" id="AutoNumber1">
<tr>
<td width="100%" style="border-style: none; border-width: medium" colspan="3">
Lütfen ödeme yapacağınız bankanın yanındaki kutuyu işaretleyiniz.</td>
</tr>
<tr>
<td width="5%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<input type="radio" value="akbank" name="banka"></td>
<td width="32%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<img border="0" src="http://www.mysite.com/images/akbank.gif" width="140" height="36"></td>
<td width="63%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<font color="#0000FF">Akbank :</font> Şube kodu (<font color="#FF0000">020</font>)<br>Hesap no (<font color="#FF0000">444</font>)<br>Hesap Sahibi ()</td>
</tr>
<tr>
<td width="5%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<input type="radio" value="isbank" name="banka"></td>
<td width="32%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<img border="0" src="http://www.mysite.com/images/isbank.gif" width="140" height="36"></td>
<td width="63%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<font color="#0000FF">İş Bankası :</font> Şube kodu (<font color="#FF0000">1077</font>)<br>Hesap no (<font color="#FF0000">444</font>)<br>Hesap Sahibi ()</td>
</tr>
<tr>
<td width="5%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<input type="radio" value="yapikredi" name="banka"></td>
<td width="32%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<img border="0" src="http://www.mysite.com/images/yapikredi.jpg" width="104" height="78"></td>
<td width="63%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1" bordercolor="#00FF00">
<font color="#0000FF">Yapı Kredi
:</font> Şube kodu (<font color="#FF0000">091</font>)<br>Hesap no (<font color="#FF0000">444</font>)<br>Hesap Sahibi ()</td>
</tr>
<tr>
<td width="5%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:none; border-bottom-width:medium" bordercolor="#00FF00">
<input type="radio" value="postaceki" name="banka"></td>
<td width="10%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:none; border-bottom-width:medium" bordercolor="#00FF00">
<img border="0" src="http://www.mysite.com/images/pttbanka.gif" width="110" height="50"></td>
<td width="85%" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1; border-bottom-style:none; border-bottom-width:medium" bordercolor="#00FF00">
<font color="#0000FF">Posta çek hesabı :</font> <font color="#FF0000">444</font><br>Hesap sahibi ()</td>
</tr>
</table>
</div>
<div id="b2" style="display:none;">
<table width="323" border="0" cellpadding="0">
<tr>
<td width="132">Kart tipi </td>
<td width="10"> : </td>
<td width="167"><select size="1" name="kart_tipi">
<option selected value="American Express">American Express</option>
<option value="Master Card">Master Card</option>
<option value="Visa">Visa</option>
</select></td>
</tr>
<tr>
<td>Kredi Kartı No</td>
<td> : </td>
<td><input type="text" maxlength="16" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" name="kart_no" size="20" /></td>
</tr>
<tr>
<td>Kart Sahibi </td>
<td> : </td>
<td><input type="text" name="kart_Sahibi" size="20" /></td>
</tr>
<tr>
<td>Son Kullanma Tarihi</td>
<td> : </td>
<td><select size="1" name="tarih">
<option selected value="0">Ay</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
/
<select size="1" name="D3">
<option selected value="0">Yil</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013"> 2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
</select></td>
</tr>
<tr>
<td>CV Kodu</td>
<td> : </td>
<td><input type="text" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" maxlength="3" name="T3" size="8" /></td>
</tr>
<tr>
<td colspan="3">Kartinizin arka kisminda kart numarasi sonunda
yazili 3 haneli rakamdir.</td>
</tr>
<tr>
<td colspan="3" align="center"><img border="0" src="http://www.mysite.com/images/cv.jpg" width="282" height="176" /></td>
</tr>
</table>
</div>
<div id="b3" style="display:none;">
Kapıda ödeme yapabilmeniz için lütfen <a href="http://www.mysite.com/siparis">
burayı</a> tıklayarak okuyunuz.
</div>
</td>
</tr>
<tr>
<td> </td>
<td height="28"><span class="style6">Güvenlik Numarası </span></td>
<td height="28">:</td>
<td height="28"><table border="0">
<tr>
<td><iframe src="kod.php?id=<?=$rand?>" width="150" height="50" frameborder="0" scrolling="no"></iframe></td>
<td align="left"><input name="kod" type="text" id="kod" style="width:80px;" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td height="28"> </td>
<td height="28"> </td>
<td height="28">
<input class="image_button" id="image_button" type="submit" value="" />
</td>
</tr>
<tr>
<td> </td>
<td height="28"> </td>
<td height="28"> </td>
<td height="28">
<p> </p>
<p> </p>
</td>
</tr>
</table>
</form>
<?
}
?>
<script language="javascript">
imageButtonAdd('image_button');
</script>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
