Welcome Guest, Not a member yet? Register   Sign In
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)




Theme © iAndrew 2016 - Forum software by © MyBB