Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.