Jump to content
tsuby

Filtrare text care contine si caractere speciale

Recommended Posts

Posted

Incerc sa adaug un text in baza de date. Nu am inca BBCode, dar vreau sa adaug in viitor.

Care e cea mai buna cale pentru a filtra textul primit, care m-ar lasa sa folosesc (orice fel de?) caractere speciale si sa fie totusi sigur?

Posted

Introduci cu:

$text = stripslashes($text);

$text= mysql_real_escape_string($text);

$query= "Insert ... ($text)";

extragi cu:

$query="Select ...";

...

$text=$result;

$text = stripslashes($text);

echo ($text);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...