PHP as a Form Option Value

I recently started using PHP and came across a problem while trying to use a PHP script as an option value. Here’s what the code basically looks like:


Option One ">Option Two


What’s wrong with this code?

The code is fine. But it is not clear what is your goal? When you submit form, the value entered to text field named “option” will be added as option to your select element. Probably you meant to interactively populate select box with new options without submitting the form? If so - you need to use javascript (ex: jQuery library).

Sponsor our Newsletter | Privacy Policy | Terms of Service