PHP Sanitation Security User Input POST Request Safely

View previous topic View next topic Go down

PHP Sanitation Security User Input POST Request Safely

Post by jamied_uk on 28th May 2016, 00:41




w3schools.com/php/php_filter.asp

w3schools.com/php/showphp.asp?filename=demo_filter2

Live Temp Example
http://jnet.sytes.net/apps/random/temperature/


File Example Including Temperature Converter Code

https://app.box.com/s/ufm5budw58zq6z4goobdtxzhv1ikc0w9
avatar
jamied_uk
Admin

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

http://address-shortner.co.uk

Back to top Go down

Re: PHP Sanitation Security User Input POST Request Safely

Post by jamied_uk on 28th May 2016, 01:56

A Class To Do This Well For You


Code:
<?php



// Class::Function





class cleanMe {

   public function cleanMefun($input) {

     $input = mysql_real_escape_string($input);

     $input = htmlspecialchars($input, ENT_IGNORE, 'utf-8');

     $input = strip_tags($input);

     $input = stripslashes($input);

     return $input;

   }

}



cleanMe::cleanMefun($_post['.....']);



 // mysqli_real_escape_string(connection,escapestring);

?>
avatar
jamied_uk
Admin

Posts : 2268
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