Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Shoutbox - polskie znaki
-EKCI-
post
Post #1





Goście







Witam Was.

Wrzuciłem na mój autoindexowalny katalog shoutbox - http://www.shoutpro.com/index.php jednak nie działają w nim polskie znaki.
Plik, do którego wrzucane są shouty to zwykły .php bez niczego poza treścią.

To fragment pliku php, który odpowiada za tworzenie wpisów:
  1. if($action=="post"){
  2. if (!$name) echo("<script>alert(\"".$inputname."\");</script>");
  3. else if (!$shout || $shout=="treść") echo("<script>alert(\"".$inputshout."\");</script>");
  4. else {
  5. //Prepare the shout
  6. $shout = trim($shout);
  7. $shout = stripslashes($shout);
  8. $shout = str_replace ("\n", " ", $shout);
  9. $shout = str_replace ("\r", " ", $shout);
  10. badname($name);
  11. if(!namelength($name,$nameminlength,$namemaxlength)) die(); //Check length of name to min and max lengths
  12. $shout = first($shout);
  13. $name = first($name);
  14. if(!length($shout,$minlength,$maxlength)) die(); //Check length of shout to min and max lengths
  15. //Find the date and time
  16. $date = date("j.m.Y", time() + $timeoffset * 3600);
  17. $time = date("H:i", time() + $timeoffset * 3600);
  18. //Add the shout to the end of shouts.php
  19. if($FilePointer = fopen("shouts.php", "a+")){
  20. fwrite($FilePointer,"$name|^|$shout|^|$date|^|$time|^|$_SERVER[REMOTE_ADDR]|^|\n");
  21. fclose($FilePointer);
  22. }
  23. }
  24. echo("<script>location.href='shoutbox.php';</script>");
  25. }


Jest możliwość włączenia zapisywania treści z polskimi znakami? Zmiana kodowania tego pliku nie zostaje zapamiętana...
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 17:04