Welcome Guest, Not a member yet? Register   Sign In
Prevent null values on input post
#1

Just extends Input Core


PHP Code:
<?php

class My_Input extends CI_Input
{
    function 
__construct()
    {
        
parent::__construct();
    }

    
/**
     * Fetch an item from the POST array
     *
     * @param    mixed    $index        Index for item to be fetched from $_POST
     * @param    bool    $xss_clean    Whether to apply XSS filtering
     * @return    mixed
     */
    
public function post($index NULL$xss_clean NULL)
    {
         
$value $this->_fetch_from_array($_POST$index$xss_clean);
                 if(
is_null($value)){ return ''; }
        return 
$value;
    }

Reply


Messages In This Thread
Prevent null values on input post - by jonathanq - 09-29-2017, 10:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB