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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.