![]() ![]() Information in there, so it is best not to allow any tags. If you allow tags, you allow all tags, regardless of whether they have any extra unwanted Using this method you can eliminate most users from adversely changing the style of your site, however it is still possible for users to cause trouble if you allow a list of certain HTML tags, for example, we could abuse the allow tag using CSS: THIS SITE SUCKS!. Here are two examples of stripping out tags: Hello!" Īfter running that script, $a will be set to "Hello!", whereas $b will be set to "Hello!" because we had "" in the list For example, if you create your own messageboard forum on your site a user could post a titleĪlong the lines of: THIS SITE SUCKS!, which, because you would display the titles of each post on your board, would display their unwanted message in huge letters on your visitors' screens. This function can be very helpful if you ever display user input on your site. Strip_tags() is a function that allows you to strip out all HTML and PHP tags from a given string (parameter one), however you can also use parameter two to specify a list of HTML tags you want. How do I remove all HTML tags from a string in Kotlin?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |