Jump to content

PHP validation


vkara101

Recommended Posts

Hey everyone, this is my first post and also my first attempt at PHP.

 

I'm wondering if anyone can help me. I am trying to validate a form field using that following statement.

 

function is_valid_email($firstname_field)

{

  return preg_match('What do i put here???', $firstname_field);

}

if (!is_valid_email($firstname_field))

{

  echo 'Sorry, invalid name';

  exit;

  }

 

What i want to do is have the field to check that it contains only letters, either lower or upper case. But i can't figure out what needs to go in the bit where i've put 'What do i put here'

 

I'd be grateful for any help. Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/43017-php-validation/
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.