prevent sql injecton using filter in php


Filter or Validate email in the form to prevent sql injection:
filter_input(INPUT_POST, ‘EMAIL’, FILTER_VALIDATE_EMAIL)
Filter or Validate number and integer in the form to prevent sql injection:
filter_input(INPUT_POST, ‘age’, FILTER_VALIDATE_INT)
Filter or Validate url to prevent sql injection:
filter_input(INPUT_COOKIE, ‘url’, FILTER_VALIDATE_URL)
Filter or Validate text or text area in the form to prevent sql injection:
filter_input(INPUT_POST, ‘msg’, FILTER_UNSAFE_RAW)
Filter or Validate variable to prevent sql injection:
filter_var($user_data, FILTER_SANITIZE_STRING)

 

Advertisements
About

myself pramodh kumar yet another php developer from India and have worked on oops,procedural,yii framework,codeigniter,wordpress,joomla,api and more.

Tagged with: , , , , , , , , , , , ,
Posted in php

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow php tutorial on WordPress.com
categories
Calendar
April 2014
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930  
Follow me on Twitter
Blog Stats
  • 73,826 hits
%d bloggers like this: