File: /home/sinanpasha/public_html/risale/yeni/mesaj-formu.php
<?php
include ("include/uye-oturum.php");
// Formdan bilgileri $_POST ile çek.
$ad_soyad = $_POST ["ad_soyad"];
$email_adresi = $_POST ["email_adresi"];
$mesaj = $_POST ["mesaj"];
$guvenlik_kodu = $_POST ["guvenlik_kodu"];
$uretilen_kod = $_POST ["uretilen_kod"];
?>
<!doctype html>
<html lang="tr">
<head>
<meta charset="utf-8">
<title>Bil Soft Eticaret - Mesaj Formu</title>
<meta name="language" content="tr">
<meta name="description" content=" ">
<meta name="author" content="Bil Shop Eticaret Sitesi">
<meta name="robots" content="index,follow">
<meta name="Copyright" content="Tüm hakları Bil Shop Firmasına aittir.">
<link rel="stylesheet" type="text/css" href="css/stiller.css">
<link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- Responsive için gerekli Head kodu başladı -->
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/stiller-responsive.css">
<link rel="stylesheet" href="js/responsive-menu/slicknav.css">
<script src="js/responsive-menu/modernizr.min.js"></script>
<!-- Responsive için gerekli Head kodu bitti -->
</head>
<body>
<!-- ==================== Header Top ==================== -->
<?php
include("include/header-top.php");
?>
<!-- ==================== Wrapper Top ==================== -->
<div id="wrapper" class="sablon_width">
<?php
include ("include/header.php");
?>
<div id="page_title">
<h1>MESAJ FORMU</h1>
</div>
<div id="page_resim">
<img src="resimler/sablon-resimleri/e-ticaret-resim.jpg" width="972" height="360" alt="Bil Eğitim E-ticaret">
</div>
<div id="page_content">
<form name="form1" method="post" action="">
<p><strong>Ad Soyad</strong><br>
<input name="ad_soyad" type="text" id="ad_soyad" size="30" maxlength="50" value="<?php echo $ad_soyad;?>">
</p>
<p><strong>Email Adresi</strong><br>
<input name="email_adresi" type="text" id="email_adresi" size="30" maxlength="50" value="<?php echo $email_adresi;?>">
</p>
<p><strong>Mesaj</strong><br>
<textarea name="mesaj" cols="30" rows="5" id="mesaj"><?php echo $mesaj;?></textarea>
</p>
<p>
<strong>Güvenlik Kodu</strong><br>
<input type="text" name="guvenlik_kodu" value="" size="10" maxlength="6">
<?php
$rastgele_kod = substr(md5(rand(1000,9999)),5,6);
echo "<span style='color:#F00;'>$rastgele_kod</span>";
?>
<input type="hidden" name="uretilen_kod" value="<?php echo $rastgele_kod;?>">
</p>
<p>
<input type="submit" name="button2" id="button" value="Mesajı Gönder">
</p>
<p>
<?php
if ($_POST ["button2"]) {
// Butona basılmış ise kontrolleri yaptır.
if (!$ad_soyad) {
echo "Ad soyad giriniz";
} elseif (!$email_adresi) {
echo "Email adresi giriniz";
} elseif (!$mesaj) {
echo "Mesaj giriniz";
} elseif (!$guvenlik_kodu) {
echo "Güvenlik kodu giriniz";
} elseif ($guvenlik_kodu != $uretilen_kod) {
echo "HATA : Güvenlik Kodu hatalı";
} else {
// Mesajı Email Olarak gönder
include_once("smtp-email-gonder/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->IsHTML(True);
$mail->Host = "mail.phpkursum.com";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "Php1234";
$mail->From = "[email protected]";
$mail->Fromname = "phpkursum.com";
$mail->AddAddress("[email protected]","Mail gönderimi");
$mail->AddAddress("[email protected]","Mail gönderimi");
$mail->AddAddress($email_adresi,"Mail gönderimi");
$mail->Subject = "Phpkursum Mesaj";
$mail->Body =
"
<table width='100%' border='0' cellspacing='5' cellpadding='5'>
<tr>
<td width='120'><strong>Ad Soyad</strong></td>
<td width='10'><strong>:</strong></td>
<td>$ad_soyad</td>
</tr>
<tr>
<td><strong>Email Adresi</strong></td>
<td><strong>:</strong></td>
<td>$email_adresi</td>
</tr>
<tr>
<td><strong>Mesaj</strong></td>
<td><strong>:</strong></td>
<td>$mesaj</td>
</tr>
</table>
"
;
if(!$mail->Send()) {
echo '<font color="#F62217"><b>Gönderim Hatası: ' . $mail->ErrorInfo . '</b></font>';
exit;
}
echo '<center> <font color="#41A317"><b>Mesaj başarıyla gönderildi. </b></font> </center> ';
//-----------------------------
}
//---------------------------------------------
}
?>
</p>
</form>
</div>
<?php
include("include/adres.php");
?>
</div>
<!-- ==================== Footer Bottom ==================== -->
<?php
include("include/footer.php");
?>
</body>
</html>