PHP FILTER SECURITY EXAMPLES

View previous topic View next topic Go down

PHP FILTER SECURITY EXAMPLES

Post by jamied_uk on Wed 11 May 2016 - 3:48

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
avatar
jamied_uk
Admin

Posts : 2022
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: PHP FILTER SECURITY EXAMPLES

Post by jamied_uk on Wed 11 May 2016 - 3:50

http://www.howtogeek.com/howto/37920/the-50-best-registry-hacks-that-make-windows-better/
avatar
jamied_uk
Admin

Posts : 2022
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum