|
Main (PHP)
3rd Party Streams
Resources
Code Snippets
Affiliates
|
|
|
| |
Minimal Cross Site Scripting Hints |
| By admin (2007-10-11. 8195 views.) |
A common attack on web sites is to plug in HTML code directly into a form field and attempt to gain control over some part of the site. |
|
<?php PHP has 3 built-in functions that will help in your efforts:
- htmlspecialchars(str)
- htmlentities(str)
- strip_tags(str, allowed)
htmlspecialchars converts the entire string passed into HTML - converting all the angle brackets and such into HTML equivalents
htmlentities takes any special character encountered and returns the HTML escape value for it
strip_tags will remove any html tag it finds EXCEPT those mentioned in the allowed string
So, overall a nice small section of functions that should alleviate a good portion of the pain of a CSX attack. ?>
|
| |
|
| |
|
|
|
|
|
|
|
|
Top Sponsor
Sponsors
Sponsors
Advertisting
Affiliates
|
|