PHP/jQuery to submit/save input with all special characters value

SabrinaG

New Member
Example..HTML :\[code\]<input type="hidden" value="">\[/code\]PHP :\[code\]<input type="hidden" value="http://stackoverflow.com/questions/15829006/<?php echo $value;?>">\[/code\]jQuery :\[code\]$("input:hidden").val(text);\[/code\]If \[code\]text\[/code\](JS variable) is free text, All html special characters allowed (like single quote / double quote) and save to \[code\]input:hidden\[/code\] (so submit by PHP)What is a correctly way to do ?May I use\[code\]echo htmlentities($value);\[/code\] ... in PHPor replace quotes in jQuery like \[code\].val(text.replace(/'/g,"
 
Back
Top