Link to home
Start Free TrialLog in
Avatar of lhutton
lhutton

asked on

Simple Form Validation

I have:
$body=stripslashes($_POST['message'])."\n\n\nTagline";

and:
      if (!$values['message'])
            addlisterror($error, 'Please complete the form.');

How do I ensure that 'message' isn't empty? There is an array between these snippets with 'message' => $body
Avatar of BOTA-X
BOTA-X
Flag of United States of America image

if (empty($values['message']))
          addlisterror($error, 'Please complete the form.');
Avatar of lhutton
lhutton

ASKER

That doesn't work. It must still be recognising "\n\n\nTagline".
ASKER CERTIFIED SOLUTION
Avatar of BOTA-X
BOTA-X
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lhutton

ASKER

Thanks!