So I'm fairly proficient with PHP but entirely new to the world of PHP 5 and PEAR. Picked up a book and have been doing what I can with it. Came across a problem so far that I haven't been able to find any help on.
When someone submits their email address, I know PEAR validates it to make sure it's legit, but now I want to restrict certain email addresses. For instance, the client only wants corporate email addresses submitted through the form. So all personal accounts such as gmail, aol, yahoo, comcast, etc. should not be able to "complete registration".
I guess I'm missing two things. First, can you incorporate regular PHP back into the PEAR stuff. If I have:
$values = $form->exportValues();
$stmt->bindParam(':email', $values['email']);
Can I run a check on $values['email'] as though it were a regular variable? Asking this question, I actually think it's possible....Hmmm. It is, isn't it?
Second thing being, is there a way to add that kind of validation into the PEAR validation? I noticed you can use a != operator, but what if I only wanted to match part of the email address. Specifically the second part? Could you do a email != %@gmail.com ? In addition, what's the syntax for that?
OH, Oh, oh! One more thing. Can you do check boxes in PEAR on a form? I saw something for radio buttons, but couldn't find much on check boxes if you could point me in the right direction. Thanks in advance.