Jump to content

Tanu

New Members
  • Posts

    1
  • Joined

  • Last visited

Tanu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Create a html or PHP script to receive user input in four text fields: a) Full Name (First Last), b) Canadian zip code, c) username. Write a PHP script using PCRE functions and regular expressions to validate these inputs. Your script should output the user inputted values, and return a message indicating which of these four fields has an error, and which of these fields are valid inputs. You are not making any changes to the inputs, but merely checking to see if the inputs are valid or not. a) Full Name: Should not contain any numbers or other characters, should only contain letters. First and last names should be separated by a space. Check if the total number of characters in the name is no more than 20 characters (e.g., Adam Taylor). b) Canadian Zip: Should contain 7 characters including a space in the middle after 3 characters, starting with a letter and alternating with numbers (e.g., V6T 1Z4). c) Username: It should be a combination of alphanumeric characters, periods and underscores. (Note: The username cannot be entirely numeric.). Username should not include any spaces. It should not start or end with a period or underscore. It should be at least 6 characters, and no more than 10 characters.
×
×
  • 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.