checking status of a HTML checkbox

From: Date: Fri, 10 Jan 2003 09:14:13 +0000
Subject: checking status of a HTML checkbox
Groups: php.general 
Request: Send a blank email to php-general+get-131062@lists.php.net to get a copy of this message
Hi, If I pass a <FORM> (using POST) from one php script to another, which contains the following HTML checkbox: <INPUT type="checkbox" name="insurance" value="yes"> I know that the input will only be passed if the checkbox is ticked... but how do I check if the checkbox was ticked and the value has actually been passed ? At the moment I am doing this: if ( $_POST["insurance"] == "yes" ) { } But is there a more "accurate" way of checking the exsistence of "insurance" ? Many Thanks, Shams

« previous php.general (#131062) next »