Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> php i flash...
rumpel
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 2.11.2005

Ostrzeżenie: (0%)
-----


Witam...
jako, że po części udało mi się rozwiązać problem z polskimi znakami, mam teraz kolejny problem, a mianowicie... treść z newsflash.php jest zaczytywana do flasha do pola dynamictext i tam wyświetlana, jednakże flash zaczytuje tylko jej część, tak jakby ją okrajał do 20 znaków...

kiedy wywołuje newsflash.php poprzez przeglądarke, to widzę cała treść....
kiedy podmieniłem plik newsflash.php na inny w którym dałem tylko $newsy=treść która ma więcej niż 20 znaków....
to flash przeczytał ładnie całą wiadmość, więc jest jeszcze jakiś konflikt na lini php->flash... może ktoś miał podobny problem ?

ps. przepraszam, że na forum o php piszę o flashu, jednakże na tym forum spotkałem się z miłym i profesjonalnym odzewem.

Właśnie sprawdziłem... wczytuje do momentu, aż napotka na literkę "ó"...
poniżej cały kod php... pewnie mam gdzieś błąd... ;/
<?php
$dbname = "pcprsmod"; //nazwa bazy danych
$dbuser = "root"; // nazwa uzytkownika
$dbpw = "krasnal"; //haslo
$dbhost = "localhost"; //lokacja bazy danych
$open = mysql_connect($dbhost, $dbuser, $dbpw) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

function iso2utf($tekscik) {
$tekscik = str_replace("\xb1", "\xC4\x85", $tekscik); //ą
$tekscik = str_replace("\xa1", "\xC4\x84", $tekscik); //Ą
$tekscik = str_replace("\xe6", "\xC4\x87", $tekscik); //ć
$tekscik = str_replace("\xc6", "\xC4\x86", $tekscik); //Ć
$tekscik = str_replace("\xea", "\xC4\x99", $tekscik); //ę
$tekscik = str_replace("\xca", "\xC4\x98", $tekscik); //Ę
$tekscik = str_replace("\xb3", "\xC5\x82", $tekscik); //ł
$tekscik = str_replace("\xa3", "\xC5\x81", $tekscik); //Ł
$tekscik = str_replace("\xf1", "\xC5\x84", $tekscik); //ń
$tekscik = str_replace("\xd1", "\xC5\x83", $tekscik); //Ń
$tekscik = str_replace("\xf3", "\xC3\xB3", $tekscik); //ó
$tekscik = str_replace("\xd3", "\xC3\x93", $tekscik); //Ó
$tekscik = str_replace("\xb6", "\xC5\x9B", $tekscik); //ś
$tekscik = str_replace("\xa6", "\xC5\x9A", $tekscik); //Ś
$tekscik = str_replace("\xbc", "\xC5\xBC", $tekscik); //ż
$tekscik = str_replace("\xac", "\xC5\xBB", $tekscik); //Ż
$tekscik = str_replace("\xbf", "\xC5\xBA", $tekscik); //ź
$tekscik = str_replace("\xaf", "\xC5\xB9", $tekscik); //Ź
return $tekscik;
}

$output = "&newsy=";
$sql=mysql_query("SELECT * FROM niusy ORDER BY Id_Niusy DESC LIMIT 1") or die (mysql_error());
while($row=mysql_fetch_array($sql))
{ $Tytul=$row["Tytul"];
$Zajawka=$row["Zajawka"];

$output.="$Zajawka";
}

$output=iso2utf($output);
echo $output;


?

Ten post edytował rumpel 21.11.2006, 12:03:10
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
rumpel
post
Post #2





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 2.11.2005

Ostrzeżenie: (0%)
-----


Okazało się, że wszystko to wina FCKEditor'a (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

zapisuje "ó" jako &oacute;

dodałem jeszcze dwie linijki kodu do skryptu (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) i teraz działa a wygląda następująco (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
  1. <?php
  2. function iso2utf($tekscik) {
  3. $tekscik = str_replace("xb1", "xC4x85", $tekscik); //ą
  4. $tekscik = str_replace("xa1", "xC4x84", $tekscik); //Ą
  5. $tekscik = str_replace("xe6", "xC4x87", $tekscik); //ć
  6. $tekscik = str_replace("xc6", "xC4x86", $tekscik); //Ć
  7. $tekscik = str_replace("xea", "xC4x99", $tekscik); //ę
  8. $tekscik = str_replace("xca", "xC4x98", $tekscik); //Ę
  9. $tekscik = str_replace("xb3", "xC5x82", $tekscik); //ł
  10. $tekscik = str_replace("xa3", "xC5x81", $tekscik); //Ł
  11. $tekscik = str_replace("xf1", "xC5x84", $tekscik); //ń
  12. $tekscik = str_replace("xd1", "xC5x83", $tekscik); //Ń
  13. $tekscik = str_replace("xf3", "xC3xB3", $tekscik); //ó
  14. $tekscik = str_replace("xd3", "xC3x93", $tekscik); //Ó
  15. $tekscik = str_replace("xb6", "xC5x9B", $tekscik); //ś
  16. $tekscik = str_replace("xa6", "xC5x9A", $tekscik); //Ś
  17. $tekscik = str_replace("xbc", "xC5xBC", $tekscik); //ż
  18. $tekscik = str_replace("xac", "xC5xBB", $tekscik); //Ż
  19. $tekscik = str_replace("xbf", "xC5xBA", $tekscik); //ź
  20. $tekscik = str_replace("xaf", "xC5xB9", $tekscik); //Ź
  21. $tekscik = str_replace("&oacute;", "xC3xB3", $tekscik); //ó
  22. $tekscik = str_replace("&Oacute;", "xC3x93", $tekscik); //Ó
  23. return $tekscik;
  24. }
  25. ?>


pozdrawiam i dziękuje za wsparcie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował rumpel 21.11.2006, 13:16:02
Go to the top of the page
+Quote Post

Posty w temacie
- rumpel   php i flash...   21.11.2006, 11:53:16
- - Amorph   A jak te dane odbierasz we flashu ?!?!?...   21.11.2006, 12:22:15
- - rumpel   wczytuje coś takiego: [PHP] pobierz, plaintext ...   21.11.2006, 12:52:23
- - Amorph   System.useCodepage = true; używałeś ?   21.11.2006, 12:53:44
- - rumpel   Okazało się, że wszystko to wina FC...   21.11.2006, 13:15:47


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: 17.10.2025 - 13:58