sql inject protection without complicated class php script and tutorial

  • HOME  • tutorials  • photos   • free grafics design    • questions and answers  • distance calculator  • maps
   



CATEGORIES
EXCEL TUTORIAL
SQL TUTORIAL
WEB INFORMATION
WINDOWS
JAVASCRIPT SCRIPTS
COMPUTER SECURITY
GRAFIC DESIGN
HTML
PHP
CSS STYLE
ATLAS OF THE WORLD
DEVELOPER
PHOTOSHOP
MAGAZINE
TOP LISTS
LATEST ARTICLES
base64 decode online free tool javascript
base64 encode online free tool using javascript
array slice php funtion
how to tell google to not change your page title with dmoz title
md5 hash generator online tools windows linux c php
remove duplicates in html lines online javascript
documentgetelementbyid()innerhtml javascript set example
how to block processes from starting and running in windows xp
list of us american presidents with pictures
ucwords javascript convert online tool
  home   PHP » SQL INJECT PROTECTION WITHOUT COMPLICATED CLASS PHP SCRIPT AND TUTORIAL
google ads
 
 
 

SQL INJECT PROTECTION WITHOUT COMPLICATED CLASS PHP SCRIPT AND TUTORIAL


Views: 172
SQL INJECT PROTECTION PHP SCRIPT (WITHOUT COMPLICATED CLASSES) TUTORIAL



SQL injection is a problem that is using by anyone who want to access your data from the SQL or delete this data or it can cause extreme problems.

There are many php script arround de Internet extremely complicated wich occupying more inutile hosting space.

I will propose a very simple sql inject protection script and equally effective, even better :) than sql injection php classe (s)



When someone want to hack your Sql database is using a variabile from your page.

eg.

Let say that a part of your page is user_page.php?id=3

And you get this id in this way

 

$id=$_GET['id'];

This is the vulnerabile part.

If getting variabile must to be a number the solution is very simple.

You have to do :

 

if(!is_numeric($id){ echo'Suspicios sql inject'; exit;}

But if the getting variabile must be alphanumeric this solution is no longer valabile.
And we do this:

your structure page is:

user_page.php?name=john

 

$user=$_GET['name'];
$aValid = array('_', '.');#accepted nonalphanumeric characters
$usr=str_replace($aValid, '', $user);
if(!ctype_alnum($usr)) {echo'incorect user name format (only alphanumeric and _ .) , posibile sql inject'; exit;

 


Leave a comment

Your name *
Your comment *
   Anti Spam code *

.
Articles related to SQL INJECT PROTECTION WITHOUT COMPLICATED CLASS PHP SCRIPT AND TUTORIAL
Zero result!

Tags:sql inject protect,sql inject php script,
There are no comments on this article...



the latest articles:
• base64 decode online free tool javascript
• base64 encode online free tool using javascript
• array slice php funtion
• How to tell google to not change your page title with DMOZ title
• MD5 hash generator Online tools Windows Linux C Php
• Remove duplicates in html lines online javascript
• documentgetElementById()innerHTML javascript set Example
• How to block processes from starting and running in Windows XP
• List of us american presidents with pictures
• Ucwords javascript convert online tool
difference between gmt and est time what is
how to select from sql a value having single quote
what is the height of statue of liberty
hollywood movies
map from faisalabad to hasilpur pakistan
driving distance between tanga and bagamoyo

 

eXTReMe Tracker