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
dutaAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.