if (isset($_POST['teklif'])) {
$adsoyad = $_POST['adsoyad'];
$email = $_POST['email'];
$telefon = $_POST['telefon'];
$price = $_POST['price'];
$mesaj = htmlclean($_POST['mesaj']);
$tarih = date('Y-m-d H:i:s');
$ip = $_SERVER['REMOTE_ADDR'];
$toplama = $_POST['toplama'];
$captcha = $_POST['g-recaptcha-response'];
if (isset($captcha) && !empty($captcha)) {
$secretKey = $cSecretKey;
$url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha);
$response = file_get_contents($url);
$responseKeys = json_decode($response, true);
if (!$responseKeys["success"]) {
echo '
Doğrulama hatası!
';
} else {
if ($adsoyad == "" || $email == "" || $price == "" || $mesaj == "" || $toplama != "14") {
echo '
Lütfen tüm alanları doldurun!
';
} else {
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo '
Lütfen geçerli bir e-mail adresi girin!
';
} else {
$number = $db->query("select count(*) from teklifler where email='" . $email . "'")->fetchColumn();
if ($number == "1") {
echo '
Teklifiniz daha önce kaydedilmiş, bu yüzden şuan teklif veremezsiniz. Yeni teklif verebilmeniz için satıcının teklifinizi silmiş olması gerekir.
';
} else {
$kayit = $db->prepare("insert into teklifler SET adsoyad=?,email=?,telefon=?,telefon2=?,text=?,teklif=?,tarih=?,ip=?");
$insert = $kayit->execute(array($adsoyad, $email, $telefon, $domainName, $mesaj, $price, $tarih, $ip));
function sendRequest($site_name,$send_xml,$header_type) {
//die('SITENAME:'.$site_name.'SEND XML:'.$send_xml.'HEADER TYPE '.var_export($header_type,true));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$site_name);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$send_xml);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header_type);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
return $result;
}
$username = '5422551550';
$password = 'Servisler242424';
$orgin_name = 'OkanAkpolat';
$content = $adsoyad . " kişisinden " . $domainName . " alan adı için " . $price . "TL değerinde yeni bir teklif var.";
$receipent = '5422551550';
$xml = "
".$username."
".$password."
".$orgin_name."
01/05/2013 18:00
".$content."
".$receipent."
";
$result = sendRequest('http://api.iletimerkezi.com/v1/send-sms',$xml,array('Content-Type: text/xml'));
echo '
Teklifiniz kaydedilmiştir. Uygun görüldüğü takdir de e-mail adresinize (varsa telefon numarasına) dönüş yapılacaktır.
İlginize teşekkür ederiz.
';
}
}
}
}
} else {
echo '
Lütfen tüm alanları doldurun!
';
}
}
?>