Ahoj, chtel bych poradit kde mám chybu kdyz se mi neco odesle do textaku tak se mi to tam cele nejak posune ale nemelo by,,,,tad je kod:
$stzprava1 = "<font face=\"Arial\" size=\"2\" color=\"#505050\"><b>$jmeno </b></font><font face=\"Arial\" size=\"1\" color=\"#505050\">$mail<br>$datum1 $datum2</font><br><font face=\"Arial\" size=\"2\" color=\"#505050\">$vzkaz</font><br><br>";
$stzprava2 = "<font face=\"Arial\" size=\"2\" color=\"#505050\"><b>$jmeno </font><font color=\"red\" size=\"2\">*</b> </font><font face=\"Arial\" size=\"1\" color=\"#505050\">$mail<br>$datum1 $datum2</font><br><font face=\"Arial\" size=\"2\" color=\"#505050\">$vzkaz</font><br><br>";
if ($jmeno == "" && $vzkaz == "") {
header('Refresh: 0; URL=web.php?stranka=guestbook');
}
else {
if ($zak == "ano") {
$zprava = wordwrap($stzprava2, 50, "\n", 1);
$zpravy = Fopen ("textaky/guestbook.txt", "w");
Fputs($zpravy, stripslashes( $zprava ));
Fputs($zpravy, $starez);
Fclose($zpravy);
}
else {
$zprava = wordwrap($stzprava1, 50, "\n", 1);
$zpravy = Fopen ("textaky/guestbook.txt", "w");
Fputs($zpravy, stripslashes( $zprava ));
Fputs($zpravy, $starez);
Fclose($zpravy);
}
}
?
dekuji
Jak posune a co to přesně dělá ve výstupu?
ve výpisu to vyhodí jméno a &n bsp; protoze se to v textaku rozlozi do vice radku.....A ono se to nevejde tak se to nbsp rozdeli a tak se to zmrsi
Tady davam kousek z toho textaku:
<font face="Arial" size="2"
color="#505050"><b>ahoj
&n
bsp; </b></font><font face="Arial" size="1"
color="#505050">ahoj<br>16:23
08.04.04</font><br><font face="Arial"
size="2" color="#505050">ahoj</font><br><br><font face="Arial" size="2"
color="#505050"><b>ahoj
&n
bsp; </b></font><font face="Arial" size="1"
color="#505050">ahoj<br>16:23
08.04.04</font><br><font face="Arial"
size="2" color="#505050">ahoj</font><br><br><font face="Arial" size="2"
color="#505050"><b>ahoj
&n
bsp; </b></font><font face="Arial" size="1"
color="#505050">ahoj<br>16:23
08.04.04</font><br><font face="Arial"
size="2" color="#505050">ahoj</font><br><br><
mala pripominka, misto
header('Refresh: 0; URL=web.php?stranka=guestbook');
muzes pouzit tohle, pouzije se to na strane serveru:
header('Location: web.php?stranka=guestbook');
jo diky ale s tim poradit nechci,,,,Ale dobra pripominka dik
uz vim proc to je je to tim wordwrap($stzprava1, 50, "\n", 1); ale navim jak jinak,,,,
neslo by to ukladat do textaku bez toho formatovani?
treba takto:
jmeno # email # datum # vzkaz /n
nacist do pole;
a u vystupu pak jen pridavat formatovani?
usetri se misto a je to prehlednejsi.
jo to máš pravdu, ale já vubec nevim jak poradis mi?
treba takhle nejak =>
....
$zaznam=$jmeno.'#'.$email.'#'.$datum.'#'.$vzkaz \n;
fopen()
.....
fputs($zpravy,$zaznam)
....
$filename="textaky/guestbook.txt"
$f=fopen($filename, "r");
while (!feof ($f))
{
$data=FGetS($f,128);
$radek=explode("#",$data);
echo "<nejake formatovani> $radek[0] <nejake formatovani> $radek[1] <nejake formatovani> $radek[2] $radek[3] <nejake formatovani> $radek[4] ";
}
fclose($f);