PDA

View Full Version : addslashes & strip_tags code


Gio~Logist
09-02-2005, 11:38 PM
// MOD :: ALLOW HTML IN PROFILEFIELDS

// OLD CODE
// $userfields .= ", $varname = '" . addslashes(htmlspecialchars_uni($$varname)) . "'";
// NEW CODE
$userfields .= ", $varname = '" . addslashes(strip_tags($$varname, $vboptions['allowedhtmltags'])) . "'";
// END OF MOD


I used this code in my functions_user.php in order to allow CERTAIN html. However, everytime my user inputs a quote now ("), it strips it and it dissapears. Any suggestions?

The even weirder part is that it updates fine and shows and stuff in PROFILE... btu when u go to edit your rpofile, it doesn't show. Almost as if you didn't edit anything at all yet the quotes show in profile.


Edit: I took one look at my html and saw the problem....

Guest190829
09-03-2005, 02:02 AM
<a href="http://us3.php.net/manual/en/function.htmlspecialchars.php" target="_blank">http://us3.php.net/manual/en/functio...ecialchars.php</a>, that should be what your looking for...but I think there is a special vb function...I forgot the name of it.