tmm öyle yapalım
3 Dosya var 3 ününde kodları yazıyorum aşağıya
1) friend.php
PHP- Kodu:
<?
$link = $HTTP_REFERER;
include("config.php");
?>
<form method="post" action="process.php">
<input type="hidden" name="link" value="<? echo $link ?>">
<table border="0" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td colspan="2" width="625"><font size="3"><? echo $title?></font></td>
</tr>
<tr>
<td colspan="2" width="625"><? echo $suggest_exp ?></td>
</tr>
<tr>
<td width="232"><? echo $yourname ?> </td>
<td width="381"><input type="text" name="sname" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmail ?></td>
<td width="381"><input type="text" name="smail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $recipientmail ?></td>
<td width="381"><input type="text" name="rmail" size="40"></td>
</tr>
<tr>
<td width="232"><? echo $yourmessage ?></td>
<td width="381"><textarea name="message" cols="34" rows="8">Merhaba
Ben bu maili sana www.supermankenler.com aracılığıyla atıyorum. Bi sayfayı çok beğendim ve senin ile paylaşmak istediğim. Sayfanın adresi aşağıda yazıyor.
Sayfanın Adresi:
<? echo $link ?></textarea></td>
</tr>
<tr>
<td width="232"> </td>
<td width="381">
<div align="left">
<input type="submit" name="submit" value="<? echo $submitbutton ?>">
</div>
</td>
</tr>
</table>
</form>
2) Config.php
PHP- Kodu:
<?
//--- Must Edit The Following Variables ---------------------------------------------------//
$mailtosender="1";
$sitename="Süper Mankenler";
$url="http://www.supermankenler.com";
$adminmail="supermankenler@supermankenler.com";
$title="Sayfayı Arkadaşına Gönder";
$thankyousubject="Arkadaşınıza Sayfa Gönderilmiştir.";
//--- Edit The Stylesheet Here! ----------------------------------------------------------//
$font="verdana"; // eg. verdana, arial, tahoma
$fontcolor="#000000"; // hex colour value
$fontsize="10pt"; // enter size in 'pt' i.e: 10pt
$formfontsize="10pt";
$formbgcolor="#0066CC";
$formfontcolor="#FFFFFF";
$scrollbars="#0066CC";
$scrollarrows="#FFFFFF";
//--- Do NOT Edit These ----------------------------------------------------------------//
$yourname="Sizin Adınız";
$yourmail="Sizin Mailiniz";
$recipientmail="Arkadaşınızın Maili";
$yourmessage="Mesajınız";
//--- Edit these if you wish -------------------------------------------------------------//
$goback="« Geri DÖn";
$submitbutton=" Gönder ! ";
$suggest_exp="Lütfen boş alanların hepsini doldurunuz.";
$mailsubject="Arkadaşınız size ziyaret etmeniz için bir sayfa gönderdi.";
$bestwishes="Saygılarımla";
$thankyoumessage="Teşekkürler";
$invalidmail="Girdiğiniz mail adresi geçersiz.";
$emptyfield="Lütfen boş alanların hepsini doldurunuz.";
$emptymail1="Lütfen boş alanların hepsini doldurunuz.";
$mailsent="Teşekkürler $sname, sayfa başarıyla gönderildi. Gönderilen kişi :";
$mailproblem="Bir sorun oluştu. Lütfen tekrar deneyiniz.";
$error="Hata!";
//--- End of Config
?>
3) process.php
PHP- Kodu:
<?
include("config.php");
?>
<html>
<head>
<META NAME="Title" CONTENT="<? echo $title?>">
<title><? echo $title?></title>
<link rel="stylesheet" href="stylesheet.php" type="text/css">
</head>
<body>
<?
if(isset($submit))
{
function msg($messagetype,$m)
{
global $goback;
?>
<br>
<br>
<table width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><? echo $messagetype ?></td>
</tr>
<tr>
<td>
<?
echo "<li>".$m."</li><P>";
echo"<center><br><input type=\"button\" value=\"".$goback."\" onClick=\"history.go(-1)\"></center> ";
?>
</td>
</tr>
</table>
<p>
<?
exit;
}
// Checks the form submission
/*---------------------------------------------------------------------------------------*/
/* function checks the empty fields */
function check_fields($field,$fieldname,$errormessage)
{
if (empty ($field))
{
msg("$errormessage","$fieldname");
}
}
check_fields ("$sname","$yourname","$emptyfield");
/* Function checks the validity of the email addresses */
function check_email($email,$mailtype,$errmessage)
{
global $emptymail1,$emptymail2;
if (!empty($email))
{
$mail_test= trim($email);
// credit to the function creator
if (!eregi("^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$", $mail_test))
{
msg( "$errmessage","$mail_test");
}
}
else
{
msg( "$emptymail1","$mailtype");
}
}
check_email("$smail","$yourmail","$invalidmail");
check_email("$rmail","$recipientmail","$invalidmail");
/* building the mail body */
$mailbody=$message."\n";
if (empty($message))
{
$mailbody.="Check out this link:\n";
$mailbody.=$link;
}
$mailbody.="\n$bestwishes,\n$sname\n";
$mailbody.="\n-------------------------------------------------------\n";
$mailbody.=$author;
$mailheaders="From: $sname<$smail>\n"; // bug fix - thanks rahul!
/* building the body of the mail for the sender */
if ($mailtosender=="1")
{
$smailbody=$sname.",\n";
$smailbody.=$thankyoumessage."\n";
$smailbody.="\n-------------------------------------------------------\n";
$smailbody.=$author;
$smailheaders="From: $sitename<$adminmail>\n";
mail($smail,$thankyousubject,$smailbody,$smailheaders);
}
/* sends the mail */
if (@mail($rmail,$mailsubject,$mailbody,$mailheaders))
{
msg( "$mailsent","$rmail");
}
else
{
msg ("$error","$mailproblem");
}
}
?>
</body>
</html>