User Tools

Site Tools


web_development:fix_post_quotes

Adding this bit of code to the top of your PHP document will run through any _POST content and convert characters to their safe HTML equivalent. Eg. “ becomes ". This may help in many situations where a quote or apostrophe may break your output.

Source Code:

fix_post_quotes.php
<?php
  foreach($_POST as $key => $value){
	  $_POST[$key] = stripslashes(htmlentities($value));
	}
?>
web_development/fix_post_quotes.txt · Last modified: 2012/01/26 09:01 by import