chcel by som vás poprosiť že či by sa tu niedko našiel kto by mi napísal php kód (aj s html formulárom) na úpravu txt súboru?
Skúšal som hladať ale nenašiel som to
Ďakujem.
Kód: Vybrať všetko
<?php
$file = "test.txt";
if(isset($_POST['text'])){
$fh = fopen($file, 'w');
fwrite($fh, $_POST['text']);
} else {
$ff = implode("\n",file($file));
?>
<form action="" method="post">
<textarea name="text"><?php echo $ff; ?></textarea>
<input type="submit" name="submit" />
</form>
<?php
}
?>
Kód: Vybrať všetko
<?php
$file = "test.txt";
if(isset($_POST['text'])){
$fh = fopen($file, 'w');
if(fwrite($fh, $_POST['text']))
echo "Dáta boli úuspešne uložené";
else
echo "Dáta sa nepodarilo uložiť";
} else {
$ff = implode("\n",file($file));
?>
<form action="" method="post">
<textarea name="text"><?php echo $ff; ?></textarea>
<input type="submit" name="submit" />
</form>
<?php
}
?>