• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
stupid input problem

#11
[eluser]xwero[/eluser]
The changed post method

Code:
function post($index = NULL, $xss_clean = FALSE)
    {        
        if(is_null($index))
                {
                    if(count($_POST) == 0)
                    {
                        return FALSE;
                    }
                    else
                    {
                        if($xss_clean === TRUE)
                        {
                             foreach($_POST as $key => $val)
                             {
                                 $_POST[$key] = $this->xss_clean($val);
                             }
                        }
                        else
                        {
                            return $_POST;
                        }
                   }
                }
        
        if ( ! isset($_POST[$index]))
        {
            return FALSE;
        }

        if ($xss_clean === TRUE)
        {
            if (is_array($_POST[$index]))
            {
                foreach($_POST[$index] as $key => $val)
                {                    
                    $_POST[$index][$key] = $this->xss_clean($val);
                }
            }
            else
            {
                return $this->xss_clean($_POST[$index]);
            }
        }

        return $_POST[$index];
    }

#12
[eluser]soupdragon[/eluser]
going back to this problem (was busy elsewhere)

I am now at the moment using

if(!empty($_POST)) {
# then check individual inputs
if($this->input->post('genre')) {

because if i dont i get errors...
Severity: Notice

Message: Undefined variable: input

I am sure this is wrong BUT help.... (at least _POST works)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.