Perad Posted November 28, 2006 Share Posted November 28, 2006 if (empty($_POST['first_name'])) {This is ignoring zero's. Does anyone know of anything which checks to see if the submit box is empty yet perceives zero as a value. Link to comment https://forums.phpfreaks.com/topic/28717-if-empty_postfirst_name-ignoring-0s/ Share on other sites More sharing options...
Jenk Posted November 28, 2006 Share Posted November 28, 2006 [code=php:0]if (empty($_POST['field']) && $_POST['field'] !== 0)[/code] Link to comment https://forums.phpfreaks.com/topic/28717-if-empty_postfirst_name-ignoring-0s/#findComment-131480 Share on other sites More sharing options...
Perad Posted November 28, 2006 Author Share Posted November 28, 2006 Ah of course. Its been a long day, thanks a lot :D Link to comment https://forums.phpfreaks.com/topic/28717-if-empty_postfirst_name-ignoring-0s/#findComment-131481 Share on other sites More sharing options...
taith Posted November 28, 2006 Share Posted November 28, 2006 [code]if(!isset($_POST['field']))[/code] Link to comment https://forums.phpfreaks.com/topic/28717-if-empty_postfirst_name-ignoring-0s/#findComment-131495 Share on other sites More sharing options...
Jenk Posted November 28, 2006 Share Posted November 28, 2006 [code=php:0]$_POST['field'] = '';[/code]That will pass your example, but not empty(). Link to comment https://forums.phpfreaks.com/topic/28717-if-empty_postfirst_name-ignoring-0s/#findComment-131498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.