Önceden hazırlamış olduğum iletişim formu denk geldi php arşivimi gezerken ve sizlerle paylaşmak istedim. Sitelerinizin iletişim bölümlerinde kullanabilirsiniz. Geliştirerek ajax ile süsleyebilir ve spam engellemek için güvenlik kodu ekleyebilirsiniz. 49. satırda ki mail adresini kendinize göre düzenleyiniz. Sayfayı iletisim.php isminde kaydediniz.
Kod:
<!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-*****="Content-Type" **********text/html; charset=iso-8859-9" />
<title>Ofis Soft İletişim Formu</title>
</head>
<body>
<?php
function gonder($ad,$soyad,$mail,$konu,$mesaj)
{
$kimden = "www.ofissoft.com";
$baslik = "Yeni Bir Mesaj Gönderildi!";
$sablon = '<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 Bir Mesaj 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=iso-8859-9\r\n";
mail ("mail@ofissoft.com",$baslik,$sablon,$header);
if (mail) { echo '<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"><span style="font-family:Tahoma; font-size:12px; color:#006600;">Mesajınız Bize Ulaşmıştır. İlginiz İçin 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 #060; padding:5px; margin-bottom:10px;"><tr><td align="center"><span style="font-family:Tahoma; font-size:12px; color:#006600;">Mesajınız Gönderilirken Bir Sorun Meydana Geldi.</span></td>
</tr></table>'; }
}
if (@$_GET['islem'] == "gonder") { gonder($_POST['ad'],$_POST['soyad'],$_POST['mail'],$_POST['konu'],$_POST['mesaj']); }
?>
<form action="iletisim.php?islem=gonder" method="post" style="margin: 0px;">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #666;">
<tr>
<td height="30" colspan="3" align="center" bgcolor="#0099CC" style="border-bottom:1px solid #666;"><span style="font-family:Tahoma; font-size:12px; color:#FFF;">Ofis Soft İletişim Formu</span></td>
</tr>
<tr>
<td width="103" height="30" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;"> Adınız</span></td>
<td width="5" align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td width="292" align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">
<input type="text" name="ad" style="width:280px; border:1px solid #666;" /></span></td>
</tr>
<tr>
<td height="30" align="left" bgcolor="#F3F3F3"><span style="font-family:Tahoma; font-size:12px; color:#000;"> Soyadınız</span></td>
<td align="center" bgcolor="#F3F3F3"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="center" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">
<input type="text" name="soyad" style="width:280px; border:1px solid #666;" id="soyad" />
</span></td>
</tr>
<tr>
<td height="30" align="left" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;"> Mail Adresiniz</span></td>
<td align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">:</span></td>
<td align="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">
<input type="text" name="mail" style="width:280px; border:1px solid #666;" id="mail" />
</span></td>
</tr>
<tr>
<td height="30" 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="center" bgcolor="#EEEEEE"><span style="font-family:Tahoma; font-size:12px; color:#000;">
<input type="text" name="konu" style="width:280px; border:1px solid #666;" id="konu" />
</span></td>
</tr>
<tr>
<td height="30" 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="center" bgcolor="#F5F5F5"><span style="font-family:Tahoma; font-size:12px; color:#000;">
<textarea name="mesaj" rows="5" style="width:280px; border:1px solid #666;"></textarea>
</span></td>
</tr>
<tr>
<td height="38" align="left" bgcolor="#F5F5F5"> </td>
<td align="center" bgcolor="#F5F5F5"> </td>
<td align="center" bgcolor="#F5F5F5"><input type="submit" value="Gönder" style="border:1px solid #666; background-color:#0099CC; color:#FFF; padding:2px;" /></td>
</tr>
</table>
</form>
</body>
</html>