Php Den Anlayanlar Bakabılırmı
-
İletişim formunda head tagları arasına altdaki kodu eklıyorum ama siteye giren kullanıcılar mesaj bıraktıgında turkce karekter sorunu oluyor ben okumak ıstedıgım zaman.. acaba sorun nerede kodları buraya yapıstıyorum.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
php kodları
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>İletişim Formu</title>
<style type="text/css">
body {
padding: 50px 100px;
font-size: 13px;
font-style: Verdana, Tahoma, sans-serif;
}
h2 {
margin-bottom: 20px;
color: #474E69;
}
input, textarea {
padding: 10px;
border: 1px solid #E5E5E5;
width: 200px;
color: #999999;
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
}
textarea {
width: 400px;
height: 150px;
max-width: 400px;
line-height: 18px;
}
input:hover, textarea:hover,
input:focus, textarea:focus {
border-color: 1px solid #C9C9C9;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
}
.form label {
margin-left: 10px;
color: #999999;
}
.submit input {
width: 100px;
height: 40px;
background-color: #474E69;
color: #FFF;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
</style>
</head>
<body>
<?php
if ($_POST){
$urun = $_POST["urun"];
$adet = $_POST["adet"];
$adsoyad = $_POST["adsoyad"];
$tel = $_POST["tel"];
$mesaj = $_POST["mesaj"];
$giris = $_POST["giris"];
$girisaylar = $_POST["girisaylar"];
$girisyil = $_POST["girisyil"];
$cikis = $_POST["cikis"];
$cikisaylar = $_POST["cikisaylar"];
$cikisyil = $_POST["cikisyil"];
if (empty($adsoyad) || empty ($mesaj) || empty($tel)) {
echo "Lutfen boş alan birakmayiniz..";
}else {
$deger = $urun."\t".$adet."\t".$adsoyad."\t".$tel."\t".$mesaj."\t".$giris.$girisaylar.$girisyil."\t".$cikis.$cikisaylar.$cikisyil."\n";
$ac = fopen("burasigizlikalsin:).txt", "a");
if (!$ac){
echo "Dosya acilamadi";
}
fwrite ($ac,$deger);
fclose ($ac);
echo "<center><h3>Tebrikler Formu basarili bir sekilde kaydedildi!<br><br>En kisa zamanda Musteri temsilcimiz tarafindan aranacaksiniz.</center></h3>";
}
}else {
echo '<h2>Bize Ulaşın</h2>
<form action="" method="post">
<table cellpadding="5" cellspacing="5">
<tr>
<td><input type="text" name="adsoyad" id="name" placeholder="Adınız Soyadınız" />
<tr>
<td><input type="text" name="tel" id="name" placeholder="Telefon Numaranız" />
</tr>
<tr>
<td><textarea rows="5" cols="50" name="mesaj" placeholder="Mesajınız"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Gonder" /><td>
</tr>
</table>
</form>';
}
?>
</body>
</html>
h2run tarafından 16/Mar/16 00:42 tarihinde düzenlenmiştir -
header('Content-Type: text/html; charset=utf-8');
sayfa başına php tagın'den sonra şunu koy.
http://stackoverflow.com/questions/4839402/how-to-write-file-in-utf-8-format
şunu da dene bi bakalım
Bir de txt dosyalarını FTP'den çekip PC'de notepad ile açıp mı okuyorsun yoksa panel mi var PHP ile txt'leri okuyup sana gösteren?
pSkpt tarafından 16/Mar/16 01:12 tarihinde düzenlenmiştir -
pskpt Sagolsun sorunu halletti ..
Yenı konu acmadan baska bı soru sormak ıstıyorum. 2 tane sub domaın actım bu sub domaın actıgım uzantılarada normal sıtedekı dosyaları atmak ıstıyorum hepsını tek tek atip db olusturmam lazımmmı yoksa baska kolay bır yontem varmı bunun ıcın.
