Forum Moderators: coopster
How to deal if someone enters something like this in textarea field?
♡♥♡♥♡♥♡♥♡♥
♡♥♡♥♡♥♡♥♡♥
♡♥♡♥♡♥♡♥♡♥
♡♥♡♥♡♥ ╔╦╦Θ
╦╦╦Θ╦╦╦Θ╦╦
╦Θ╦╦╗╔╦╦Θ╦
╦╦Θ╦╦╦Θ╦╦╦
Θ╦╦╗ ♣ E ♣ N ♣ J ♣
O ♣ Y ♣ ╚╩╩Θ╩╩╩
Θ╩╩╩Θ╩╩╩Θ╩
╩╝╚╩╩Θ╩╩╩Θ
╩╩╩Θ╩╩╩Θ╩╩
How to remove these with PHP?
Regards
Tabish
[edited by: tedster at 6:55 pm (utc) on Jan. 4, 2007]
[edit reason] added line breaks to prevent side scroll [/edit]
Not working.. it is removing all the charecters which is in that text variable. Mean if there is some text like :
$text="╦Θ╦this is text╦╦Θ╦this is text╦"
It will remove that special chracters and also the text between them also..
:(
Regards
Tabish
this is what i am trying to convert
$text="♡♥♡♥ ♡♥♡♥& #9825;♥♡♥♡ ♥♡♥♡& #9829;♡♥♡♥ ♡♥♡♥& #9825;♥♡♥♡ ♥♡♥♡♥
LOVE IS MY PASSION,
LIFE IS TOO LONG SO ENJOY EVERY MOMENT,
LIVE N LET LIVE,
DONT CARE ABT D WORLD,
╔╦╦Θ╦ ╦╦Θ╦╦ ╦Θ╦╦╦ Θ╦╦╗╔ ╦╦Θ╦╦ ╦Θ╦╦╦ Θ╦╦╦Θ ╦╦╗"
I think new line is giving problem..
when i use your preg it is returning only ",,,,,"
regards
tabish
[edited by: jatar_k at 2:23 pm (utc) on Jan. 5, 2007]
[edit reason] added spaces for sidescroll [/edit]
Your real problem is that you did not create a good enough filter to check user's input before letting the user send it to your DB.
you have two possibilities:
A) create a pattern that filters what's not allowed
B) A better one: Create a pattern that matches what's allowed (so you do not take a chance in forgetting anything)