This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

Filtrado de caracteres Mediante ASCII [PHP]

  • 0 Replies
  • 3325 Views

0 Members and 1 Guest are viewing this topic.

Online ANTRAX

  • *
  • Administrator
  • Posts: 5849
  • Actividad:
    66.67%
  • Country: ar
  • Reputación 43
  • ANTRAX
  • Twitter: @Underc0de
    • View Profile
    • Underc0de
    • Email

Filtrado de caracteres Mediante ASCII [PHP]

  • on: February 24, 2010, 11:25:14 am
Code: (php) You are not allowed to view links. Register or Login
<?php 
function detectar($ascii) { 
for (
$i 0$i strlen($ascii); $i++) { 
$byte ord($ascii{$i}); 
if(
$byte >=48 && $byte <=57 || $byte >=64 && $byte <=90 || $byte >=97 && $byte <=122) { 
$hex .= chr($byte); 
} else { print 
"Injeccion de Caracteres Detectado!\n"; exit; } 

return 
$hex

 
foreach(
$_GET as $var => $value) { 
$value detectar($value); 
$_GET[$var] = $value

 
foreach(
$_POST as $var => $value) { 
$value detectar($value); 
$_GET[$var] = $value

?>

solo pasan letras, arroba, números (ni espacios pasan).
« Last Edit: March 22, 2014, 02:23:09 pm by Expermicid »