mam taki oto kod :
[php:1:b2451d3fa4]<?php
## Utworz plik rus.txt. Ten kod zapisz w pliku zmien.php ##
$akcja=$HTTP_GET_VARS['akcja'];
if ($akcja == "konwertuj")
{
$autor=$HTTP_POST_VARS['autor'];
$tresc=$HTTP_POST_VARS['tresc'];
if ($autor == '') { die ("Brak podpisu"); }
if ($tresc == '') { die ("Brak tresci."); }
$dowcip = ereg_replace("(rn|n|r)", "<br>", $dowcip);
$tresc = str_replace ( "j", "й", $tresc );
$tresc = str_replace ( "c", "ц", $tresc );
$tresc = str_replace ( "u", "у", $tresc );
$tresc = str_replace ( "k", "к", $tresc );
$tresc = str_replace ( "e", "е", $tresc );
$tresc = str_replace ( "n", "н", $tresc );
$tresc = str_replace ( "g", "г", $tresc );
$tresc = str_replace ( "z", "з", $tresc );
$tresc = str_replace ( "h", "х", $tresc );
$tresc = str_replace ( "f", "ф", $tresc );
$tresc = str_replace ( "y", "ы", $tresc );
$tresc = str_replace ( "w", "в", $tresc );
$tresc = str_replace ( "a", "а", $tresc );
$tresc = str_replace ( "p", "п", $tresc );
$tresc = str_replace ( "r", "р", $tresc );
$tresc = str_replace ( "o", "о", $tresc );
$tresc = str_replace ( "l", "л", $tresc );
$tresc = str_replace ( "d", "д", $tresc );
$tresc = str_replace ( "s", "с", $tresc );
$tresc = str_replace ( "m", "м", $tresc );
$tresc = str_replace ( "i", "и", $tresc );
$tresc = str_replace ( "t", "т", $tresc );
$tresc = str_replace ( "b", "б", $tresc );
// brakuje jeszcze pare literek ..
# $tablica = array("w", "q");
# $tablica2 = array("ц","й");
# zapisywanie do pliku
$f=fopen("rus.txt","r+");
$tresc_pliku = fread($f, filesize("rus.txt"));
fclose ($f);
$f=fopen("rus.txt","w+");
fwrite($f, "$autor|||$trescn".$tresc_pliku);
fclose ($f);
echo "Dodano<br><a href=zmien.php?akcja=pokaz>Pokaz wpisy</a><br><a
href=zmien.php>Dodaj wpis</a>";
$fd = fopen ("rus.txt", "r+");
while (!feof ($fd)) {
$tmp = fgets ($fd);
$tmp= explode ('|||', $tmp);
echo "<center>autor: $tmp[0] <br>wpis: $tmp[1] <br><hr><br></center>"; }
fclose ($fd);
echo "<center><br><a href=zmien.php>Dodaj wpis</a></center>";
}
elseif ($akcja == "pokaz")
{
echo "<center><a href=zmien.php>Dodaj wpis</a><br><br></center>";
$fd = fopen ("rus.txt", "r+");
while (!feof ($fd)) {
$tmp = fgets ($fd);
$tmp= explode ('|||', $tmp);
echo "<center>autor: $tmp[0] <br>wpis: $tmp[1] <br><hr><br></center>"; }
fclose ($fd);
echo "<center><br><a href=zmien.php>Dodaj wpis</a></center>";
} else {
echo "<a href=zmien.php?akcja=pokaz>Pokaz wpisy</a><br>
<form method=post action=zmien.php?akcja=konwertuj>
<table align=center>
<tr><td>Autor:</td><td><input name=autor maxlength=20></td></tr>
<tr><td>Tresc:</td><td><textarea name=tresc cols=100 rows=10></textarea></td></tr>
<tr align=center><td></td><td align=center><input align=center type=submit
value=Dodaj name=wyslij ></td></tr></table>
</form>";
### brakujaca czesc kodu ###
# tu ma sie wyswietlac sformatowana pisana aktualnie $tresc
echo "<table align=center>
<tr><td>Podglad:</td><td><textarea name=tresc cols=100 rows=10
value=cos></textarea></td></tr>
</table>";
### koniec brakujacej czesci kodu ###
}
?>[/php:1:b2451d3fa4]
moze ktos wie jak zrobic by piszczac w jednym polu to w drugim wyswietlalo sie, taki podglad ..
z gory dziekuje za pomoc