Reply
Make HTML input safe?
Old 03-16-2006, 11:58 AM Make HTML input safe?
Extreme Talker

Posts: 219
Location: UK, East Anglia
At the moment when someone wants to edit their profile they have to use bb code for example for bold:

[b ] [/b ]

How do i allow users to use normal HTML but at the same time making sure it is 100% safe before inserting it into mysql?

Last edited by timsquash5 : 03-17-2006 at 12:56 PM.
timsquash5 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-16-2006, 06:33 PM Re: Make HTML input safe?
neroux's Avatar
Ultra Talker

Posts: 284
There wont be a 100% secure solution.
__________________
CityPics.org - The world at your fingertips
• Share your city with the world

-- Meet your Meat
neroux is offline
Reply With Quote
View Public Profile
 
Old 03-17-2006, 12:55 PM Re: Make HTML input safe?
Extreme Talker

Posts: 219
Location: UK, East Anglia
so is it best just to stick with BB code?
timsquash5 is offline
Reply With Quote
View Public Profile
 
Old 03-18-2006, 09:03 AM Re: Make HTML input safe?
Junior Talker

Posts: 3
you could create an array of safe tags so you could allow only those safe tags and remove all other tags from the profile
__________________
www.bitvertiser.com (pay per click)
 . ˙ ·  · .  ˙ . ˙ ·
T0MA is offline
Reply With Quote
View Public Profile
 
Old 03-18-2006, 12:18 PM Re: Make HTML input safe?
Extreme Talker

Posts: 219
Location: UK, East Anglia
How would i do that? Wouldn't i have to split the string up into tags first before i checked against the array?
Like if my string was : "<b>hello</b><i>hi</i>"
how would i split it up into an array like :
Array
(
[0] => <b>
[1] => hello
[2] => </b>
[3] => <i>
[2] => hi
[3] => </i>
)

?
timsquash5 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Make HTML input safe?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13398 seconds with 12 queries