|
|
stripslashes() after using addslashes() - PHP
|
Views : 380
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
I have noted in many places including hiox.org that we have not used stripslashes() while we display a content from database.
i.e When I try to add a scrap with some word like "it's", it adds properly. So we have used addslashes to insert this content in to db.
But when i try to edit this scrap it shows as \"it\'s\".
This is an issue..
We should have used stripslashes() before displaying the content.
Example Code:
$value = "it\'s test";
$result = stripslashes($value);
print "before stripslashes() -".$value;
print "after stripslashes() -".$result;
?>
Output of the above code:
before stripslashes() - it\'s test
after stripslashes() - it's test
|
|
By rajesh, On - 2009-10-29 |
|
|
|