Create five files for a contact form system: form.html, email.php, config.inc.php, locale.inc.php, and rewrite.txt.
**form.html**
- A self-contained HTML form within
for easy copying to other pages (e.g., blog posts).
- Include all HTML, CSS, and JavaScript within a single .
- Mark the start and end with comments: "" and "".
- Form fields:
- Name: Text box, max 50 chars, required.
- Email: Text box, max 200 chars, required.
- Gender: Radio buttons ("男" and "女"), required.
- Submit button labeled "送信する".
- On submit, collect form data as JSON and send via Ajax to email.php (URL defined as a const at the top of the script with a comment).
- If email.php returns "OK", replace the form with a stylish "メールが送信されました。" message in a div.
- If email.php returns anything else, show the response as an error in a popup dialog (using a div, not alert()), with an "OK" button to close it.
- Style:
- Responsive design, bright and intellectual look.
- Inputs have a blue, fuzzy outline on focus.
- Radio buttons are 1em x 1em squares.
**email.php**
- Receives form data from form.html, sends it as an email.
- Use UTF-8 encoding to prevent character issues.
- Include config.inc.php and locale.inc.php (assumed in the same directory).
- Store configurable settings in config.inc.php.
- Return "OK" on successful email sending; otherwise, return an error message from locale.inc.php.
- Avoid including site-specific info (e.g., email addresses, server details) in error messages for security.
**config.inc.php**
- Define email-related settings in the format: $cfg["key"] = value;
- Include comments explaining each setting.
**locale.inc.php**
- Define error messages in the format: $lca["key"] = "message";
- Include comments explaining each message.
**rewrite.txt**
- A simplified, clear version of this prompt.