<?php
// Check for posted data
if(filter_has_var('INPUT_POST', 'data')){
echo 'Data Found';
} else {
echo 'No Data';
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="text" name="data">
<button type="submit">Submit</button>
</form>
I get this error and the input is not changing to "Data Found" when I submit a data.
Warning: filter_has_var() expects parameter 1 to be int, string given in /Applications/MAMP/htdocs/php_front_to_back/filters.php on line 3 No Data