Review: Full, Anonymous: No Write a function that validates mailstops for Acme Corp. Valid mailstops consist of a one or two-digit building number, followed by a dash and a single letter. For example, 1-B and 21-C are valid mailstops. 1B, 133-A and 14-AB are not. Your function should accept a string mailstop and return TRUE if the mailstop is valid, and FALSE if it is not. Write your own regular expression for validation. Define an array of mailstops including: 1-B, 21-C, 133-A, and 14-AB. Then, evaluate each mailstop in the array and display a message indicating whether or not each value is valid. Use a loop and your validation function. Your output should look like this (with valid mailstops in green, invalid in red): 1-B is a valid mailstop 21-C is a valid mailstop 133-A is not a valid mailstop 14-AB is not a valid mailstop Now, create a form that allows a user to input a mailstop. The form should submit to itself A submitted mailstop should be fully sanitized (strip white space, remove tags, entitize characters, etc) and lowercase letters should be capatilized automatically When a user enters a mailstop into the form and clicks "Validate Mailstop" (which is the value of the submit button) the input should be sanitized and then run through the validation function. If valid, the output should say bla-bla is a valid mailstop (in green text) or bla-bla is an invalid mailstop (in red text). Next, using PHP (CREATE TABLE IF NOT EXISTS ...) create a table on ned to store your entries (both valid and invalid). Modify your code so that when a user enters a mailstop it is sanitized and then stored in the table (using PDO). Then write a query to select all stored mailstops from the table and display them to the user below the form. So when a user visits your Mailstop Validator form they will see a textbox for input and a "Validate Mailstop" button. Below that they will see a list of previous mailstops entered in red (for invalid mailstops) and green (for valid mailstops). When they enter a mailstop the form will submit to itself, save the mailstop to the database, and display it below the submit button along with the rest as either a valid or invalid mailstop. Make sure you comment out your initial strings and arrays containing mailstops so that they aren't resubmitted to the database everytime someone visits the page. Only store the actual mailstop in the database (both working and unworking). Don't store the "is a valid mailstop" or the "is not a valid mailstop". Use your function to append the appropriate message, and make sure your function is also supplying the proper css to make each mailstop red or green (using a span tag with a class of green or red).
Hello again! Thank you for requesting me.I will contact you once this is complete.Thank you
Do you think you can have this done by 11:30PM?
I don't see the array
Define an array of mailstops including: 1-B, 21-C, 133-A, and 14-AB. Then, evaluate each mailstop in the array and display a message indicating whether or not each value is valid. Use a loop and your validation function. Your output should look like this (with valid mailstops in green, invalid in red)
Thanks Doc for your help