Jump to content

specialchars() user input but allow mine..


manix

Recommended Posts

Okay, that's a little confusing - say there's a user input commenting on some stuff and I need it to be displayed exactly the way the user input it, but I also need to be able to run some tags I'm adding/modifying later on to the same string

 

Let me give you a simple example:

 

let's say a user's comment contains "some text and <some tags> AND some of my encoding tags like *b*this*/b*"

 

Okay so this string is supposed to output "some text and <some tags> AND some of my encoding tags like this"

 

You get my point?

 

if I decode the *b*'s into <strong></strong> then using htmlspecialchars() will display my tag too instead of running it - what I am aiming to do ...

and using strip_tags() allowing <strong> will allow the user to input it too

 

I hope someone can help me out with this one cuz I've been struggling with it for 2 days >.<

 

Thank you in advance!

Link to comment
https://forums.phpfreaks.com/topic/242282-specialchars-user-input-but-allow-mine/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.