PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PHP Sanitation Security User Input POST Request Safely

Go down

PHP Sanitation Security User Input POST Request Safely Empty PHP Sanitation Security User Input POST Request Safely

Post by jamied_uk 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
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

PHP Sanitation Security User Input POST Request Safely Empty Re: PHP Sanitation Security User Input POST Request Safely

Post by jamied_uk 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);

?>
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

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