The loop can generate the HTML for the options on the fly, and the check for whether the option has been selected or not can be incorporated into it: If youre not yet familiar with PHP loops, you may want to read the Learning Loops article. How do I submit an offer to buy an expired domain? To subscribe to this RSS feed, copy and paste this URL into your RSS reader. There are numerous articles on the Web about choosing between them, but my advice is to stick to POST when using forms, unless you have a good reason to pass user data in a viewable URL. Second part is about validating email addresses with PHP. Lets create the HTML form. These fields cannot be empty and must be filled out in the HTML form. You can do more validation on Client-Side as per your need to make your code more secure. The value attribute for each option element is the value that will be submitted to the server, and the text between the opening and closing option tag is the value the user will see in the select menu. In the above table, every field marked required is a compulsory field. i imagine there is something i could do with javascript but i haven't been able to figure it out. htmlspecialchars() converts special characters such as &(ampersand) into HTML entities &. Can a remote machine execute a Linux command? Now to the problem. Connect and share knowledge within a single location that is structured and easy to search.