[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

PHP validation (length check on email address and major)

Hi again!

I am sorry to ask you one more similar question to the one I asked before.

I have a script (as seen below) to validate name, major, GPA and email address.
I have no problem except on email. The problem with email address is that people can put a real lengthy (currently there is no limit) address which is most likely a bogus one.

I need your help to invalidate an email address which is abnormally too long (say, 60-characters).

The script to check the length of name worked fine. So I tried that to check the length of email, but it did not work.

Hope you may kindly help me out again!

Thanks again!

duta

June 3, 2006, at 2:56 pm
0
duta
Asked:
duta
  • 2
  • 2
1 Solution
 
RoonaanCommented:
You can use

if(strlen($_POST['emailField']) > 80) {
  //fail email field
}

-r-
0
 
dutaAuthor Commented:
TO: Roonaan:

Thank you so much for your kind, prompt response.

Your tip worked just great.

I am very honored to get help from a great master like you (your point: 939030). The number just testifies that you have helped a lot of  people.

Thanks!

duta

June 3, 2006, at 3:09 pm
0
 
RoonaanCommented:
Hi duta,

Thanks for your kinds words. I didn't get that many points by being selective on who I help out. As all experts I try just to help out as much as I can. For php I have the privilige to be able to answer a lot of questions.

-r-
0
 
dutaAuthor Commented:
TO: Roonaan:

Thank you so much for your kind response.
I wish that someday I will be able to help others as you are doing so wonderfully and thoughtfully. Help is the best gift you can give a beginner like me.

I have always thought that it is a great privilege to get help from a master like you at experts-exchange.

God bless you!

duta

June 3, 2006, at 9:33 pm
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now