PHP FILTER SECURITY EXAMPLES
Page 1 of 1
PHP FILTER SECURITY EXAMPLES
- Code:
<?php
// ?url=
if(isset($_GET['url'])) {
$url = preg_replace('#[^a-z0-9]#i', '', $_GET['url']);
}
?>
<?php
$url = "http://www.w3schools.com";
// Remove all illegal characters from a url
$url = filter_var($url, FILTER_SANITIZE_URL);
// Validate url
if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
echo("$url is a valid URL");
} else {
echo("$url is not a valid URL");
}
?>
http://www.w3schools.com/php/php_filter.asp
Similar topics
» Password passwords lists pdf examples security
» TUT AND CODE EXAMPLES AND SITE LINKS For Javascript & More
» Node.js FFMPEG Project to Add 3D & 8D Effect to Audio MP3 File Using apulsator Filter in Express
» Some Python Examples
» PHP QR Code Examples & Enabling GD PHP
» TUT AND CODE EXAMPLES AND SITE LINKS For Javascript & More
» Node.js FFMPEG Project to Add 3D & 8D Effect to Audio MP3 File Using apulsator Filter in Express
» Some Python Examples
» PHP QR Code Examples & Enabling GD PHP
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum