PHP Classes

File: examples/utils_sqlprotect.php

Recommend this page to a friend!
  Classes of Everton da Rosa   XtPHP   examples/utils_sqlprotect.php   Download  
File: examples/utils_sqlprotect.php
Role: Example script
Content type: text/plain
Description: Example script
Class: XtPHP
General purpose library of utility classes
Author: By
Last change:
Date: 9 years ago
Size: 410 bytes
 

Contents

Class file image Download
<?php
//Exemplo de utilização de XtUtils::sqlProtect() e XtUtils::sqlUnprotect()

require '../utils.php';

$usuario = 'teste';
$senha = ' \' or 1=1\''; // leia http://imasters.com.br/artigo/5179/sql_injection_no_php_o_que_e_e_como_se_proteger

echo "<p>Protegendo $senha</p>";

echo
$protegido = XtUtils::sqlProtect($senha);

echo
"<p>Desprotegendo $string</p>";

echo
XtUtils::sqlUnprotect($protegido);

?>