Explanation in Shiflett's PHP Security Briefing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was reading PHP Security Briefing from brainbulb.com (Chris Shiflett) and didn't get one thing:
in example:

<?php
   $clean = array();
   if (ctype_alnum($_POST['username']))
   {
       $clean['username'] = $_POST['username'];
   }
?>

why to set the $clean as array? what's wrong if I use:

<?php
   if (ctype_alnum($_POST['username']))
   {
       $clean = $_POST['username'];
   }
?>


-afan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux