Tanu Posted November 19, 2016 Share Posted November 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
benanamen Posted November 19, 2016 Share Posted November 19, 2016 We are not going to do your homework for you. What have you tried? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted November 19, 2016 Share Posted November 19, 2016 Gee, when I was looking for something for nothing in school, at least I tried to disguise the way I asked for help. To copy the professor's homework assignment verbatim is pretty darn.... well, you know. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.