have a form that I would like to validate before it is submitted to the DB.
I am having trouble with a couple of sections.
I have a select box with a listing of all the states, the first option is
Choose One with a value of 0. Would this be the correct way to
validate this field?
CODE
See below for point-by-point.
...
CODE
$state = $_POST['state'];
if ($state = 0) {
= is an assignment operator. This will always test true, because $state
is set to 0 every time this is called. You want ==, which is a
comparison operator.
print 'pPlease select your