- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the methods for sanitizing user inputs with PHP?
Sanitizing of inputs is an interesting concept in PHP. Sanitizing means escaping the unauthorized characters in the input. Let's learn some best practices to process the inputs in a safe and secure way.
Use of real_escape_string() funnction in mysqli statements.
<?php $conn= new mysqli("localhost", "root","","testdb"); $street = $conn->real_escape_string($_POST['street']); ?>
we can use htmlentities() and html_entity_decode() while insert data in database and displaying in Browser.
<?php $data['message'] = htmlentities($message);//at the time of insert in database echo html_entity_decode($data['message']); //at the time of display in browser ?>
Sanitize user-input when in Command Prompt by using escapeshellarg.
<?php system('ls '.escapeshellarg($data['dir']));?>
- What are the methods for Clustering with Constraints?
- What are the methods for generating frequent itemsets?
- What are getters and setters methods in PHP?
- Taking multiple inputs from user in Python
- What are the methods for expressing attribute test conditions?
- What are the methods for constructing an Ensemble Classifier?
- What are the clustering methods for spatial data mining?
- What are the data Mining methods for Recommender Systems?
- Add feedback icons for inputs with Bootstrap
- What are the methods for the generation of concept hierarchies for nominal data?
- What are the methods for Data Generalization and Concept Description?
- What are Getters/Setters methods for Python Class?
- What are the conditions for Collection factory methods in Java 9?
- What are the methods of clustering?
- What are Hierarchical Methods?