Teşekkür eder, iyi çalışmalar dilerim.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
if(isset($_FILES['dosya'])){
$hata = $_FILES['dosya']['error'];
if($hata != 0) {
echo 'Yüklenirken bir hata gerçekleşmiş.';
} else {
$boyut = $_FILES['dosya']['size'];
if($boyut > (1024*1024*3)){
echo 'Dosya 3MB den büyük olamaz.';
} else {
$tip = $_FILES['dosya']['type'];
$isim = $_FILES['dosya']['name'];
$uzanti = explode('.', $isim);
$uzanti = $uzanti[count($uzanti)-1];
if($tip != 'image/jpeg' || $uzanti != 'jpg') {
echo 'Yanlızca JPG dosyaları gönderebilirsiniz.';
} else {
$dosya = $_FILES['dosya']['tmp_name'];
copy($dosya, 'dosyalar/' . $_FILES['dosya']['name']);
$dosyamx = '/var/httpdocs/tr/iformu/dosyalar/' . $_FILES['dosya']['name'];
$dosyatanimla = "image/jpeg";
}
}
}
}
?>
<?php
//change settings here
require("phpmailer/class.phpmailer.php");
//function to check properly formed email address
function isEmailValid($email)
{
// checks proper syntax
if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email))
{
return false;
}
return true;
}
//get contact form details
$name = $_POST['isim'];
$email = $_POST['eposta'];
$comments = $_POST['mesaj'];
//validate email address, if it is invalid, then returns error
if (!isEmailValid($email)) {
die('Invalid email address');
}
//start phpmailer code
$ip = $_SERVER["REMOTE_ADDR"];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
@$response="Tarih: " . date("d F, Y h:i:s A",time()+ 16 * 3600 - 600) ."\n" . "IP Adresi: $ip\nTarayıcı:$user_agent\nİsim Soyisim: $name\nMesajı:\nDosya: $dosyamx\n$comments\n";
//mail("info@mypapit.net","Contact form fakapster",$response, $headers);
$mail = new PHPmailer();
$mail->SetLanguage("en", "phpmailer/language");
$mail->From = $your_email;
$mail->FromName = $your_website;
$mail->Host = $your_smtp;
$mail->Mailer = "smtp";
$mail->Password = $your_smtp_pass;
$mail->Username = $your_smtp_user;
$mail->Subject = "$your_website İletişim Formu";
$mail->SMTPAuth = "true";
$mail->Body = $response;
$mail->AddAddress($your_email,"$your_website Form");
$mail->AddReplyTo($email,$name);
@$mail->addAttachment('$dosyamx,$dosyatanimla');
if (!$mail->Send()) {
echo "<p>There was an error in sending mail, please try again at a later time</p>";
echo "<p>".$mail->ErrorInfo."</p>";
} else {
echo "<p>İletişimin için çok teşekkürler, <em>$name</em>. Sizinle iletişim kuracağız!<br />3 saniye içerisinde ana sayfaya yönleneceksiniz.</p>";
}
$mail->ClearAddresses();
$mail->ClearAttachments();
?>--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:46:27 -->-> Daha önceki mesaj 15:52:58 --
Yardım rica ediyorum, teşekkürler.