Código PHP:
class FilterInput
{
public $_source;
public function __construct($source)
{
if ($source=='GET')
{
$this->_source = INPUT_GET;
} elseif ($source=='POST') {
$this->_source = INPUT_POST;
}
}
public function validaMail($value)
{
return filter_input($this->_source, $value, FILTER_VALIDATE_EMAIL);
}
}
$filterPost = new FilterInput('POST');
print $filterPost->validaMail('email');
Código:
alguna idea?nuevo_usuario Fatal error: Using $this when not in object context in C:\xampp\htdocs\ivanu\includes\Classes\class.FilterInput.php on line 18
salu2