html kodu ile Formdan Gelen Veriyi php kodu ile Txt Dosyasına Yazdırmak
<form action="mailekle.php" method="post">
E-posta: <input type="textbox" name="email" size="30">
<input type="submit" value="kaydet">
</form>
<?php
$dosya_adi = "maillistesi.txt";
$deger = $_POST["email"];
$yazilacak_deger = "$deger\n";
if ($deger) {
if (!file_exists($dosya_adi)){
touch($dosya_adi);
chmod($dosya_adi,0666);
}
$dosyaya_baglanti = fopen($dosya_adi,"a+");
if (!fwrite($dosyaya_baglanti,$yazilacak_deger)){
echo "Dosyaya yazılamadı.";
exit;
}
echo "Tamamdır. Dosyaya bak >> <a href='maillistesi.txt'>maillistesi.txt</a>";
} else {
echo "Dosyaya yazılamadı.";
}
?>
PHP'de Formdan Gelen Veriyi Txt Dosyasına Yazdırmak
Yorumlar
Yorum Gönder