Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcja obslugi stringow z formularzy
basf
post
Post #1





Grupa: Zarejestrowani
Postów: 46
Pomógł: 0
Dołączył: 11.06.2003

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


Witam

Mam klase i w niej umiescilem funkcje
  1. <?php
  2. function CheckString($INText)
  3. {
  4. $INText = str_replace(&#092;">\",\"&gt;\",$INText); $INText = str_replace(\"'\",\"&rsquo;\",$INText);
  5. $INText = str_replace(&#092;"\"\",\"&quot;\",$INText);  $INText = str_replace(\"<\",\"&lt;\",$INText);
  6. return $INText;
  7. }
  8. ?>


W skrypcie wywoluje ja tak:
  1. <?php
  2. $Dane = &#092;"<b>huh fajnie</b>\";
  3. $DaneOK = $klasa->CheckString($Dane);
  4. print $DaneOK;
  5. ?>




Chodzi o to zeby tekst Dane zostal przefiltrowany przez funkcje CheckString i zwrocony bez <> "

Gdzie robie blad bo juz zglupialem totalnie.


Basf
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: 22.08.2025 - 17:25