PHP Classes

File: ornek.php

Recommend this page to a friend!
  Classes of MUAMMER TURKMEN   Basic SQL Injection Protection   ornek.php   Download  
File: ornek.php
Role: Example script
Content type: text/plain
Description: Basic SQL Injection Protection Sample
Class: Basic SQL Injection Protection
Cleanup harmful text from request parameters
Author: By
Last change:
Date: 12 years ago
Size: 1,207 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>


// Copyright 2011-~ Muammer TURKMEN
$deneme1=new sqlinj;
$deneme1->ekleme("into"); // add custom words to list.

echo $deneme1->basla("get","veri")."<br><br>"; // only $_REQUEST["veri"] protect
echo stripslashes($deneme1->basla("get","veri")."<br><br>"); // stripslashes cleaning \ chars

echo $deneme1->basla("'''' select * from urunler where, insert into --update urunler")."<br><br>"; // clear custom text.
echo stripslashes($deneme1->basla("'''' \" \" select * from urunler where, insert into --update urunler"));
// AIO
$deneme1->basla("aio","all"); // aio -> $_REQUEST,$_GET,$_POST protect all types --- all -> all variables
echo "<br><br>".$_GET["veri"]."===".stripslashes($_GET["veri"])."<br><br>";