Jump to content

Help with validation question


keltik

Recommended Posts

I'm new to php, so please excuse my ignorance.

 

Here's my issue:

On my website, I want to ask the following question to validate the person filling in the form is a real person:

 

Which is the hottest:

FIRE or ICE ?

 

Right now, my code is only set to accept all caps - which is confusing some of my customers.

 

How to I update the following code, to allow caps and lowercase answers?

 

if (empty( $_POST['validate'] ) || !ctype_upper( $_POST['validate'] ) || ($_POST['validate']!="ICE" and $_POST['validate']!="FIRE")){

$errors->add('empty_username', __('<strong>ERROR</strong>: Please check your validation answer.'));

}

Link to comment
https://forums.phpfreaks.com/topic/255240-help-with-validation-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.