htmlentities

Validating user input?

Hi, I am very confused over something and was wondering if someone could explain. In PHP i validate user input so htmlentitiies, mysql_real_escape_string is used before inserting into database, not on everything as i do prefer to use regular expressions when i can although i find them hard to work with. Now obviously i will use mysql_r...

is there a mysql function to decode html entities?

i was wondering if there is a MYSQL function to decode text with html entities. I have seen some approaches using REPLACE but it looks kinda hard to manage all the entities. ...

How to accept programming code input for displaying purposes?

What is the safest way to accept user inputted programming code in PHP, store it in database and display it back with the HTML pre tag? I currently convert the input to HTML entities, but I somehow think it wouldn't be that easy... Any suggestions? ...

cakePHP: Overload Sanitize

In the recent cakePHP 1.3.4 version I discovered that Sanitize::html returns double encoded html entities - because of the newly added fourth parameter of htmlentities 'double_encode'. Here is a corresponding ticket on cakePHP: http://cakephp.lighthouseapp.com/projects/42648/tickets/1152-sanitizehtml-needs-double_encode-parameter-in-htm...

Decode htmlEntities back on populate Zend Form

Hi, I decode my zend-form with htmlEntities. This works great, but I would like to decode the input back when I repopulate the form back to the user. Is there a way to reverse the setElementFilter in Zend? Example: User fills in input field with You & me Data placed in the database: You & me I get the data back from the data...

PHP: htmlentities not working with variable

Hey, I'm using htmlentities() to convert characters like Ç and ® to its character codes. I'm getting the texts from the MYSQL database. while($row = mysql_fetch_array($array, MYSQL_NUM)){ echo "<div style='float:left; margin-right:40px;'> <div style='width:148px; height:141px; background-image:url(uploads/".$row[0].")'> <img src...

replacing letters (from a phrase) with images

$q = "my phrase with special chars like úção!?"; while ($i < strlen($q)) { echo '<img src="'.$q[$i].'.png" />'; $i++; } i also tried with switch/case but when i have chars like ç Ç ã â i cant get the image replacing to work since its more than one char (i was converting to html entities and then searching in the case ccedil but its ...