- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
<?php
/**
* @class Sanitize
* @author Nirmit Bothra
* @copyright 2007
* @description This class sanitizes all user input which are accessed by PHP using POST, GET or REQUEST variables. Data sanitation helps in making
* safe transactions with a database.
*/
class sanitize {
function sanitize() {
// class constructor and
$this->sanitizeCookie();
$this->sanitizeGet();
$this->sanitizeRequest();
$this->sanitizePost();
}
function sanitizePost() {
foreach($_POST as $key=>$value) {
$_POST[$key] = addslashes($value);
}
}
function sanitizeGet() {
foreach($_GET as $key=>$value) {
$_GET[$key] = addslashes($value);
}
}
function sanitizeRequest() {
foreach($_REQUEST as $key=>$value) {
$_REQUEST[$key] = addslashes($value);
}
}
function sanitizeCookie() {
foreach($_COOKIE as $key=>$value) {
$_COOKIE[$key] = addslashes($value);
}
}
}
$sanitizedData =& new sanitize();
?>
Uchkuma 09.04.2011 13:46 # 0
Lure Of Chaos 09.04.2011 14:25 # 0
Govnocoder#0xFF 09.04.2011 16:34 # −1
absolut 10.04.2011 11:18 # +1
Govnocoder#0xFF 09.04.2011 16:44 # +3
bugmenot 09.04.2011 16:48 # +1
Lure Of Chaos 09.04.2011 16:53 # 0
Uchkuma 10.04.2011 08:41 # +1
guest 10.04.2011 10:49 # 0
Lure Of Chaos 10.04.2011 11:01 # 0
каких?
Uchkuma 10.04.2011 22:17 # +3
Lure Of Chaos 10.04.2011 23:19 # 0
RaZeR 10.04.2011 20:15 # −1
Предохраняйся, %username%!
Lure Of Chaos 10.04.2011 23:19 # 0
nethak 11.04.2011 13:38 # −1
Lure Of Chaos 11.04.2011 17:36 # 0
XPSystemServices 12.04.2011 23:25 # 0
RomaShka 15.04.2011 06:32 # −1
Lure Of Chaos 15.04.2011 09:21 # 0
RomaShka 15.04.2011 13:05 # 0
RomaShka 15.04.2011 13:07 # 0
пока решил оформить отдельной кучкой )))