Search the Community
Showing results for tags 'validate'.
-
Validate User Input
abigail posted a topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
I'm working on an online store application. I'm working on the part that will get Customer's shipping address. I also want to get name, email, and phone number. My question is, what is the best way to validate all of these, especially the address. I know this is a general way of stating the question, so to clarify, this is what I am thinking. I have two goals: 1) all the data is valid in the sense I can store it in the database. 2) I want to try to make sure it is a real customer, not a scammer, so I would like to make sure everything is in a valid form. Such as a zip code is only 5 digits plus 4. A phone number is only 10 digits, etc. Is it reasonable to check if the zip code is valid for that state? I don't think it needs to be perfect. It is just for doing some basic checking before passing it through to the credit card section. -
I am having trouble creating the code to improve the security of add_print.php in Chapter 19. I am adapting the code from chapter 11 to this problem and not having any luck. I want to validate the file type before adding a print to the database. Does anyone have the solution to this review and pursue question? thanks