Jump to content

Help with HTMLentites


turkman

Recommended Posts

I am getting input from a user an i protect is like the following

function protect($val){
    
        $val = mysql_real_escape_string($val);
        $val = htmlentities($val);
        $val = trim($val);
        return $val;
    
    
    }

 

 

say for example i enter <p>html?</p>

 

Then when i extract it from the database and print it too my webpage i get

 

<p>html? </p>

 

im just looking to show the formatting but not actually use the html if you get my point.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/193616-help-with-htmlentites/
Share on other sites

i don't know if its necessary - it worked on another site i made a year ago but i havent done any php in a while, im trying to get back into it and im wondering why when i use htmlentities it converts to <p>html? </p> but when i pull it from the database and put it back onto the webpage it stays as <p>html? </p>

 

how can i get it to show the html formatting without actually doing anything.

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.